patchGNU Autoconf Archive - Patches: patch #8707, AX_APPEND_COMPILE_FLAGS: -Wno-FOO...

 
 

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

Submitter:  None
Submitted:  Sun 26 Jul 2015 11:27:51 AM UTC
   
 
Priority:  5 - Normal Status:  Wont Do
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 26 Aug 2015 09:58:47 AM UTC, comment #1: 

The patch doesn't seem right to me in so far as it has the potential to break other, legitimate uses of the macro.

I've added the original author of AX_APPEND_COMPILE_FLAGS to Cc. Hopefully Maarten can help us figure out how to proceed fixing this bug.

Peter Simons <simons>
Group administrator
Sun 26 Jul 2015 11:27:51 AM UTC, original submission:  

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.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #34528:  ax_append_compile_flags.patch added by None (572B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by simons (Posted a comment)
  • -email is unavailable- added by simons
  • -email is unavailable- added by None (Submitted the item)
  •  

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-09-25 simons StatusNeed Info Wont Do
        Open/ClosedOpen Closed
    2015-08-26 simons StatusNone Need Info
        Carbon-Copy- Added maarten bosmans <mkbosmans@gmail.com>
    2015-07-26 None Attached File- Added ax_append_compile_flags.patch, #34528

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code