You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can of course suppress warnings in cJSON from my parent project, so this is a very minor issue, but if you'd like to address it anyway in the cJSON source, then either of the changes in the patch seems to work for me:
So having different #ifdef blocks for the diagnostic sections around the cast_away_const() function isn't having the desired effect in this case, but it seems like it should be safe to combine them, which works since __clang__ is defined.
On the other hand, potentially you could get rid of the preprocessor wrappers around this function and just do an intermediate cast to uintptr_t as demonstrated in the above patch to avoid the cast qualifier warning.
Of course if you don't care to change this at all, that's fine too.
Thanks,
Benbuck
The text was updated successfully, but these errors were encountered:
Hi,
I'm compiling cJSON using CMake FetchContent with LLVM clang 16 on Windows:
This results in a compile warning because it seems to inherit the high warning levels of my parent project:
I can of course suppress warnings in cJSON from my parent project, so this is a very minor issue, but if you'd like to address it anyway in the cJSON source, then either of the changes in the patch seems to work for me:
Evidently LLVM clang 16 does not define
__GNUC__
:So having different
#ifdef
blocks for the diagnostic sections around thecast_away_const()
function isn't having the desired effect in this case, but it seems like it should be safe to combine them, which works since__clang__
is defined.On the other hand, potentially you could get rid of the preprocessor wrappers around this function and just do an intermediate cast to
uintptr_t
as demonstrated in the above patch to avoid the cast qualifier warning.Of course if you don't care to change this at all, that's fine too.
Thanks,
Benbuck
The text was updated successfully, but these errors were encountered: