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

anonymous <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.archive-maintainers
Message-ID <[email protected]>
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: [email protected]
             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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.