-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Unable to compile with gcc 4.4.7 #126
Comments
It is kind of hard to get these old compiler versions working in oder to check this. Can you check if it works when the pragma are moved before and after the function, that way it might be possible to avoid the GCC version check. |
I just checked with gcc 4.1.2 in CentOS 5 and it works, so older versions of GCC seem to just ignore the unknown pragma. Therefore if putting the pragma in front of and after the |
I've tried that in 4.4.7 and now I get a warning:
Not ideal, but good enough I guess. |
That's still problematic with |
Not sure why disabling the pragma would make it break with |
But not with The build system automatically sets these and other compiler flags if supported. |
You're right:
|
Now that there is an ENABLE_CUSTOM_COMPILER_FLAGS in CMakeLists.txt, perhaps a
can be added when it is set, and the pragmas then encased in an |
I now use the version check, but just around I checked that it compiles with |
You can take a look at it on the old-gcc branch. |
This is now fixed in cJSON 1.4.3 |
It seems gcc 4.4.7 (CentOS 6.6) does not support diagnostic inside functions:
Not 100% sure why
-Wcast-qual
is being ignored here, but I think one possible solution would be:The text was updated successfully, but these errors were encountered: