Get this thrown at compile with ./configure --enable-hardening #7394

issue Frankenmint opened this issue on January 22, 2016
  1. Frankenmint commented at 2:48 PM on January 22, 2016: none

    At global scope: cc1plus: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]

  2. 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.

  3. laanwj closed this on Jan 22, 2016

  4. laanwj added the label Build system on Jan 22, 2016
  5. laanwj reopened this on Feb 4, 2016

  6. ghost commented at 12:06 AM on April 22, 2016: none

    'Tis confusing (without --enable-hardening too).

  7. 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
    
  8. theuni commented at 6:21 AM on April 22, 2016: member

    I wrote a fix for this a while back (as well as some that @morcos pointed out on osx), but I guess I never PR'd it. I'll see if I can dig that out.

  9. 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 :-)

  10. 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).

  11. paveljanik commented at 6:45 AM on April 22, 2016: contributor

    FWIW: Removing -Wno-self-assign doesn't add new warnings here with clang 7.0.2 with the current master. I have just double-checked...

  12. 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.

  13. 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.

  14. 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.

  15. paveljanik commented at 8:16 AM on April 22, 2016: contributor

    -Wno-unused-local-typedef and -Wno-deprecated-register are 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 configure output:

    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... yes
    

    This should fix this issue and also part of #7902. Thanks!

  16. theuni commented at 8:25 AM on April 22, 2016: member

    The deprecated-register was necessary when testing c++11, we can add it later if it comes up again. I believe the unused-local-typedef comes from boost in some cases. That might've been the one bothering @morcos.

  17. paveljanik commented at 8:31 AM on April 22, 2016: contributor

    But even adding them is no problem here. Will you PR the change?

  18. theuni commented at 5:19 AM on April 23, 2016: member

    Yes, will do.

  19. laanwj commented at 10:49 AM on April 28, 2016: member

    Closing, fixed by #7954

  20. laanwj closed this on Apr 28, 2016

  21. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me