Make ENABLE_WERROR actually work#4924
Conversation
|
Hmm, it looks like this only works for GCC-like compilers. I wonder if we might also enable warnings on errors in MSVC? ( |
|
I'd also like @pks-t's thoughts here. Perhaps a |
|
hmm i thought that was the intention, given that Lines 201 to 202 in 274a37f enabling warnings on MSVC is going to take more effort, since I don't have a Windows machine and debugging on Travis is hard ^^;; |
|
actually let me split off the non-controversial part of this change to a separate PR. |
|
Done. Moved the fix of the warnings to #4928 , so this will break the Travis build until that one is merged. |
|
FYI, we don't use Travis. :) |
Yeah, I can't speak to that, as I don't think that I understand the distinction between |
|
In any case, don't worry about MSVC, I can tackle that once we've decided the direction that we want to go in. |
If I understand correctly, |
That's my understanding, too. Sorry, for additional context, what we do when In other words, instead of This feels like it should be the equivalent of I'm definitely not understand the distinction yet. 😀 |
|
yes, the two flags that i had trouble with ( |
|
All right, after a lot of debugging, I finally traced the root of the issue to the way the Warning-free builds FTW! |
This change explicitly adds -Werror to the CFLAGS. Due to the way that the ADD_C_FLAG_IF_SUPPORTED() macro was mangling the flag name to convert it into a define name, any warning that had a dash in its name was not being correctly enabled. Additionally, any flag that is enabled implicitly by the compiler (like -Wunused-result and -Wdeprecated-declarations) would not cause an error unless they were explicitly enabled with the ENABLE_WARNINGS() macro.
|
LGTM, thanks for tackling this @lhchavez ! |
|
Cool, thanks! |
|
For some background: |
|
So yeah, I tried my luck to reproduce the old behaviour I was seeing, but right now I can't. I'm not quite happy that we now pass |
|
Hmm that is very odd. I know that most maybe there was an ordering issue with |
This change explicitly adds -Werror to the CFLAGS.
Due to the way that the ADD_C_FLAG_IF_SUPPORTED() macro was mangling the
flag name to convert it into a define name, any warning that had a dash
in its name was not being correctly enabled. Additionally, any flag that
is enabled implicitly by the compiler (like -Wunused-result and
-Wdeprecated-declarations) would not cause an error unless they were
explicitly enabled with the ENABLE_WARNINGS() macro.