Skip to content

CMake: fix test for warning suppressions#5714

Closed
MarcelRaad wants to merge 1 commit into
curl:masterfrom
MarcelRaad:cmake_fix_warning_suppressions
Closed

CMake: fix test for warning suppressions#5714
MarcelRaad wants to merge 1 commit into
curl:masterfrom
MarcelRaad:cmake_fix_warning_suppressions

Conversation

@MarcelRaad
Copy link
Copy Markdown
Member

GCC doesn't warn for unknown -Wno- options, except if there are other
warnings or errors [0]. This was problematic with CURL_WERROR as that
warning-as-error cannot be suppressed. Notably, this always happened
with -Wno-pedantic-ms-format when not targeting Windows. So test for
the positive form of the warning instead, which should always result in
a diagnostic if unknown.

[0] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

GCC doesn't warn for unknown `-Wno-` options, except if there are other
warnings or errors [0]. This was problematic with `CURL_WERROR` as that
warning-as-error cannot be suppressed. Notably, this always happened
with `-Wno-pedantic-ms-format` when not targeting Windows. So test for
the positive form of the warning instead, which should always result in
a diagnostic if unknown.

[0] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

Closes
Copy link
Copy Markdown
Contributor

@jzakrzewski jzakrzewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible to me.

@MarcelRaad MarcelRaad deleted the cmake_fix_warning_suppressions branch July 23, 2020 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants