Skip to content

Suppress -Wcast-qual in cast_away_const for clang without __GNUC__ - #1088

Open
prownd wants to merge 1 commit into
DaveGamble:masterfrom
prownd:suppress-Wcast-qual-in-cast_away_const-for-clang-without-s01
Open

prownd wants to merge 1 commit into
DaveGamble:masterfrom
prownd:suppress-Wcast-qual-in-cast_away_const-for-clang-without-s01

Conversation

@prownd

@prownd prownd commented Sep 20, 2026

Copy link
Copy Markdown

fixes #1062

The diagnostic push/pop around cast_away_const() is enabled for clang, but the "ignored" pragma in between was only enabled for GNUC. clang-cl on Windows doesn't define GNUC, so builds with -Wcast-qual -Werror failed. This can be reproduced on Linux with 'clang -fgnuc-version=0 -std=c89 -Wcast-qual -Werror -c cJSON.c'.

…ixes DaveGamble#1062

The diagnostic push/pop around cast_away_const() is enabled for clang,
but the "ignored" pragma in between was only enabled for __GNUC__.
clang-cl on Windows doesn't define __GNUC__, so builds with -Wcast-qual
-Werror failed. This can be reproduced on Linux with
'clang -fgnuc-version=0 -std=c89 -Wcast-qual -Werror -c cJSON.c'.
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

Successfully merging this pull request may close these issues.

[Windows/Clang] Build failure in cJSON

1 participant