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
While skimming through the CMakeLists.txt, I found that several warning flags have inconsistent (opposite) values for gcc and clang, which seems to be a mistake (please elaborate if I'm wrong).
First inconsistency -Wzero-as-null-pointer-constant
For gcc, -Wzero-as-null-pointer-constant is explicitly enabled if the host uses gcc >= 5.0,
while for clang -Wno-zero-as-null-pointer-constant (Note the -Wno-) is set and therefore the warning is disabled.
Second inconsistency -Wshadow
Also in gcc's PEDANTIC_COMPILE_FLAGS, -Wshadow is followed by -Wno-shadow:
Possibly there are other inconsistencies or mistakes, but as the authors intent does not appear clearly to me, I am unable to further judge the other flags.
I just wanted to point out, that almost every flag passed to clang is prefixed with -Wno-, and as -Wno-zero-as-null-pointer-constant appears to be a mistake, it might be worth having a look at the other flags, too.
The text was updated successfully, but these errors were encountered:
Point 1:
I honestly don't remember what was my reasoning behind this, but it looks like a honest mistake. That warning should be enabled on both gcc and clang, and I can't think of any reason to disable it on clang, given that it's also enabled on gcc.
Point 2:
This was changed later here, I don't know why the change was done nor why it was done this way instead of simply removing the flag.
While skimming through the
CMakeLists.txt
, I found that several warning flags have inconsistent (opposite) values for gcc and clang, which seems to be a mistake (please elaborate if I'm wrong).First inconsistency
-Wzero-as-null-pointer-constant
For gcc,
-Wzero-as-null-pointer-constant
is explicitly enabled if the host uses gcc >= 5.0,while for clang
-Wno-zero-as-null-pointer-constant
(Note the-Wno-
) is set and therefore the warning is disabled.Second inconsistency
-Wshadow
Also in gcc's
PEDANTIC_COMPILE_FLAGS
,-Wshadow
is followed by-Wno-shadow
:set(PEDANTIC_COMPILE_FLAGS -pedantic-errors -Wall -Wextra -pedantic -Wold-style-cast -Wundef -Wredundant-decls -Wshadow [...] -Wno-shadow)
Other issues
Possibly there are other inconsistencies or mistakes, but as the authors intent does not appear clearly to me, I am unable to further judge the other flags.
I just wanted to point out, that almost every flag passed to clang is prefixed with
-Wno-
, and as-Wno-zero-as-null-pointer-constant
appears to be a mistake, it might be worth having a look at the other flags, too.The text was updated successfully, but these errors were encountered: