-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Compiling issues with libc 2.12 #1483
Comments
As have stated in your bugzilla link, this is more like a Adding this workaround to the library code could be problematic. Defining
However, defining such macro inside an application that its code isn't going to spread in multiple place and referenced in various people could be probably safe and can be swept under the rug. |
A user of my library hit this with glibc 2.17 also. So far as I can tell, defining More background here: |
I thought that adding a macro to the source would keep the issue locally. Older libc versions are widely used so it would be a big help for many developers. BTW: the best solution would be just simply use |
In practice, it is very unlikely that an library implementer left these specializations out though. |
We know the supported compilers. We could have issues with macros on the supported compilers while we know that numeric limits work nicely. I would go for numeric limits. |
Any proposal how to proceed here? |
I'm happy to create the change (from macro to numerical_limits). I wouldn't create, if it won't be merged. So are you okay with that solution? |
Yes, please change to numeric_limits. |
I create it till Friday. |
#1514 is opened. |
Closed by merging #1514. |
What is the issue you have?
Compile error.
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
https://sourceware.org/bugzilla/show_bug.cgi?id=15366
I have compile error in debug mode on this line:
https://github.com/nlohmann/json/blob/develop/include/nlohmann/detail/conversions/to_chars.hpp#L754
What is the expected behavior?
Code should be compiled.
And what is the actual behavior instead?
It doesn't compile.
Which compiler and operating system are you using? Is it a supported compiler?
I'm on gcc 5.3 with C++14 with RH 6 compatible ABI
(https://www.softwarecollections.org/en/scls/rhscl/devtoolset-4/ - RH 6)
Did you use a released version of the library or the version from the
develop
branch?Both.
If you experience a compilation error: can you compile and run the unit tests?
__STDC_LIMIT_MACROS
was added to the project and the issue has gone.Possible fix:
#if !defined(NDEBUG) && !defined(__STDC_LIMIT_MACROS)
#define __STDC_LIMIT_MACROS
#endif
(may be with
#pragma push_macro
and#pragma pop_macro
)to
https://github.com/nlohmann/json/blob/develop/include/nlohmann/detail/conversions/to_chars.hpp#L2
The text was updated successfully, but these errors were encountered: