Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

single header: gcc 4.8.5 fails to compile #350

Open
MountCloud opened this issue Jan 3, 2023 · 4 comments
Open

single header: gcc 4.8.5 fails to compile #350

MountCloud opened this issue Jan 3, 2023 · 4 comments

Comments

@MountCloud
Copy link

rapidyaml.hpp:643:2: error: #error "amalgamate: file c4/gcc-4.8.hpp must have been included at this point"

// provided by cmake sub-project
// amalgamate: removed include of
// https://github.com/biojppm/c4core/src/c4/gcc-4.8.hpp
//#               include "c4/gcc-4.8.hpp"
#if !defined(C4_GCC_4_8_HPP_) && !defined(_C4_GCC_4_8_HPP_)
#error "amalgamate: file c4/gcc-4.8.hpp must have been included at this point"
#endif /* C4_GCC_4_8_HPP_ */

But this path has not been found:https://github.com/biojppm/c4core/src/c4/gcc-4.8.hpp

@MountCloud
Copy link
Author

There is also this problem:

rapidyaml.hpp:3272:86: error: reference to ‘max_align_t’ is ambiguous
void* reallocate(void* ptr, size_t oldsz, size_t newsz, size_t alignment=alignof(max_align_t))

@MountCloud
Copy link
Author

I made some tweaks to rapidyaml-0.5.0.hpp and it compiles with GCC 4.8.5.

1: replace all "alignof(max_align_t)" to "alignof(std::max_align_t)"

2: remove this validation:
#if !defined(C4_GCC_4_8_HPP_) && !defined(_C4_GCC_4_8_HPP_)
#error "amalgamate: file c4/gcc-4.8.hpp must have been included at this point"
#endif /* C4_GCC_4_8_HPP_ */

@biojppm biojppm changed the title gcc 4.8.5 fails to compile single header: gcc 4.8.5 fails to compile Jan 4, 2023
@biojppm
Copy link
Owner

biojppm commented Jan 5, 2023

Thanks for reporting. Does this happen in the compiled library too?

It is hard for me to test this. The github runners no longer have support for gcc 4.8. Which distro are you using?

@MountCloud
Copy link
Author

The version I use:

gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I used this method to solve the situation where single header could not compile in GCC 4.8.5.
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

I made some tweaks to rapidyaml-0.5.0.hpp and it compiles with GCC 4.8.5.

1: replace all "alignof(max_align_t)" to "alignof(std::max_align_t)"

2: remove this validation:
#if !defined(C4_GCC_4_8_HPP_) && !defined(_C4_GCC_4_8_HPP_)
#error "amalgamate: file c4/gcc-4.8.hpp must have been included at this point"
#endif /* C4_GCC_4_8_HPP_ */

biojppm added a commit to biojppm/c4core that referenced this issue Mar 25, 2023
biojppm added a commit to biojppm/c4core that referenced this issue Mar 25, 2023
[fix] re biojppm/rapidyaml#350 - fix include guard for gcc4.8 shim he…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants