At global scope: cc1plus: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
Get this thrown at compile with ./configure --enable-hardening #7394
issue Frankenmint opened this issue on January 22, 2016-
Frankenmint commented at 2:48 PM on January 22, 2016: none
-
laanwj commented at 2:54 PM on January 22, 2016: member
That's a clang-only warning, which is disabled, but doesn't exist on gcc. Perfectly harmless.
- laanwj closed this on Jan 22, 2016
- laanwj added the label Build system on Jan 22, 2016
- laanwj reopened this on Feb 4, 2016
-
ghost commented at 12:06 AM on April 22, 2016: none
'Tis confusing (without --enable-hardening too).
-
paveljanik commented at 6:10 AM on April 22, 2016: contributor
This is even an error on some older gccs as said in #7902 (comment)
We have it hardcoded in
configure.ac:## TODO: Remove these hard-coded paths and flags. They are here for the sake of ## compatibility with the legacy buildsystem. ## if test "x$CXXFLAGS_overridden" = "xno"; then CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wno-self-assign" fi -
paveljanik commented at 6:22 AM on April 22, 2016: contributor
@theuni OK. I have just started checking what warnings get printed by each of this -W.. So I'll wait :-)
-
laanwj commented at 6:33 AM on April 22, 2016: member
We really need this warning on clang though, I remember I added it because every single file was generating a warning (code generated by macros tends to have self-assignments).
-
paveljanik commented at 6:45 AM on April 22, 2016: contributor
FWIW: Removing
-Wno-self-assigndoesn't add new warnings here with clang 7.0.2 with the current master. I have just double-checked... -
laanwj commented at 7:03 AM on April 22, 2016: member
OK, no clue then, in any case we need a mechanism for clang or gcc specific warnings.
-
theuni commented at 7:19 AM on April 22, 2016: member
@laanwj Yea, the trick is to run an autoconf check with "-Werror -Wno-self-assign" or so (we have macros for that). The annoying part is that gcc only warns on -Wno-foo when there's another warning present, so there a few other things needed. I had it nailed down to be a completely portable test, I believe. I'll dig it up.
-
theuni commented at 7:26 AM on April 22, 2016: member
Found this in my reflog: http://pastebin.com/raw/mGRe2umm . I'm unsure if that was the best version, will give it a try tomorrow. @paveljanik feel free to play with that.
-
paveljanik commented at 8:16 AM on April 22, 2016: contributor
-Wno-unused-local-typedefand-Wno-deprecated-registerare new compared to the current master. Do we need them at all?I commented them out to make comparison of build logs easier and the only change here is
configureoutput:checking whether C++ compiler accepts -Werror... yes checking whether C++ compiler accepts -Wall... yes checking whether C++ compiler accepts -Wextra... yes checking whether C++ compiler accepts -Wformat... yes checking whether C++ compiler accepts -Wformat-security... yes checking whether C++ compiler accepts -Wunused-parameter... yes checking whether C++ compiler accepts -Wself-assign... yesThis should fix this issue and also part of #7902. Thanks!
-
paveljanik commented at 8:31 AM on April 22, 2016: contributor
But even adding them is no problem here. Will you PR the change?
-
theuni commented at 5:19 AM on April 23, 2016: member
Yes, will do.
- laanwj closed this on Apr 28, 2016
- MarcoFalke locked this on Sep 8, 2021