autoconf-archive-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #8707] AX_APPEND_COMPILE_FLAGS: -Wno-FOO doesn't work with gcc


From: anonymous
Subject: [patch #8707] AX_APPEND_COMPILE_FLAGS: -Wno-FOO doesn't work with gcc
Date: Sun, 26 Jul 2015 11:27:53 +0000
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0

URL:
  <http://savannah.gnu.org/patch/?8707>

                 Summary: AX_APPEND_COMPILE_FLAGS: -Wno-FOO doesn't work with
gcc
                 Project: GNU Autoconf Archive
            Submitted by: None
            Submitted on: So 26 Jul 2015 11:27:51 UTC
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

I'd like to add -Wno-incompatible-library-redeclaration for clang.  The
obvious

    MY_APPEND_COMPILE_FLAGS([-Wno-incompatible-library-redeclaration])

does not work, because it adds it when using gcc, too.

The macro's description states:

    For every FLAG1, FLAG2 it is checked whether the compiler works with the
flag.  If it does, the flag is added FLAGS-VARIABLE

It doesn't quite work for gcc when FLAG1 is of the form -Wno-FOO,
because:

     When an unrecognized warning option is requested (e.g.,
'-Wunknown-warning'), GCC emits a diagnostic stating that the option is not
recognized.  However, if the '-Wno-' form is used, the behavior is slightly
different: no diagnostic is produced for '-Wno-unknown-warning' unless other
diagnostics are being produced.  This allows the use of new '-Wno-' options
with old compilers, but if something goes wrong, the compiler warns that an
unrecognized option is present.

    https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

An obvious way to make it work is testing -WFOO instead of -Wno-FOO.

Crude patch attached.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: So 26 Jul 2015 11:27:51 UTC  Name: ax_append_compile_flags.patch  Size:
572B   By: None

<http://savannah.gnu.org/patch/download.php?file_id=34528>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8707>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]