Improve compiler flags for warnings and disable -Wstringop-foo warnings#810
Improve compiler flags for warnings and disable -Wstringop-foo warnings#810nstoddard wants to merge 2 commits intotmewett:releasefrom
Conversation
This brings the warnings produced by GCC closer to those produced by clang. Clang still generates a few warnings that GCC doesn't seem to support, however. This also disables -Wstringop-truncation, -overread, and -overflow, since the resulting warnings are probably useless. Clang doesn't support those flags, so this unfortunately has to be done with `#pragma`s in `Rogue.h`.
|
I don't understand the disabling in the header file thing.. are the -Wstringop-* warnings coming from an umbrella -W? Won't compilers just ignore a -W that they don't understand? |
The stringop warnings seem to be enabled by default in GCC. And unfortunately Clang does not ignore unknown warning flags; instead it prints the following for every single file: From those messages, you'd think we could just add Also, using a Not sure what the compiler developers were thinking here. Unfortunately I don't see a less ugly way to handle this. |
I don't understand why clang is printing a warning for a flag that doesn't appear on the command line 🤔 |
Oops, I edited the Makefile incorrectly for that particular test (I accidentally included If these warning flags are disabled using |
|
Ok, I think this makes sense, let's do it. I'll merge when the conflicts are fixed |
86faf2d to
7691f58
Compare
|
I fixed the merge conflicts. I sorted the warning flags a bit differently than before (e.g. grouping together prototype-related flags instead of grouping together all |
7691f58 to
169ab7d
Compare
This brings the warnings produced by GCC closer to those produced by clang. Clang still generates a few warnings that GCC doesn't seem to support, however.
This also disables -Wstringop-truncation, -overread, and -overflow, since the resulting warnings are probably useless. Clang doesn't support those flags, so this unfortunately has to be done with
#pragmas inRogue.h.I recommend not merging this until #789 is merged, because that PR fixes dozens of warnings that currently only show up in Clang, and this PR will enable those warnings in GCC.