patchGNU Autoconf Archive - Patches: patch #9673, Use AX_COMPILER_VENDOR for more...

 
 

patch #9673: Use AX_COMPILER_VENDOR for more robust selection of compiler flags

Submitter:  John Zaitseff <zaitseff>
Submitted:  Mon 06 Aug 2018 04:59:13 AM UTC
   
 
Priority:  5 - Normal Status:  Done
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 14 Feb 2019 09:17:44 AM UTC, comment #3: 

Pushed to master. Thank you very much for the submission!

Peter Simons <simons>
Group administrator
Mon 06 Aug 2018 10:27:01 AM UTC, comment #2: 

A ninth patch to avoid prepending empty flags ("") to CFLAGS et al.

(file #44731)

John Zaitseff <zaitseff>
Mon 06 Aug 2018 05:08:39 AM UTC, comment #1: 

I have successfully tested this series of patches with the following compilers:

  • GCC 4.2.1, 4.4.7, 7.3.0, 8.2.0
  • Clang (LLVM) 5.0.1, 6.0.0
  • Portland PGI 18.3
  • Intel C 18.03
  • Sun (Solaris) Developer Studio 12.6


John Zaitseff <zaitseff>
Mon 06 Aug 2018 04:59:13 AM UTC, original submission:  

The AX_FLAGS_WARN_ALL macro is a very useful and simple one for adding reasonable compiler warnings, as compared with the full machinery of AX_COMPILER_FLAGS_CFLAGS and friends.  It also works with multiple compilers, unlike AX_COMPILER_FLAGS_CFLAGS which is tailored to GCC-emulating ones.

Unfortunately, AX_FLAGS_WARN_ALL uses a heuristic to determine which compiler flags to use--and that heuristic fails on many compilers.

This series of patches reworks AX_FLAGS_WARN_ALL to use AX_COMPILER_VENDOR, which is a far more robust way to select appropriate flags.  All flags in the old macro have been transferred across, with bug fixes added for current Intel compilers.  The patches depend on Patch #9671 to be applied first.

One function/file is added: AX_PREPEND_FLAG, which allows flags to be added to the front of CFLAGS, etc., to allow the user to override AX_FLAGS_WARN_ALL's selection.

I have tested this series of patches with my Star Traders game at https://www.zap.org.au/software/trader -- see the Git repository at https://www.zap.org.au/gitweb/trader.git .

If you prefer, I can combine all patches in this series into a single patch.

John Zaitseff <zaitseff>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #44725:  0005-ax_cflags_warn_all.m4-Bug-fix-the-PGI-compilers-do-n.patch added by zaitseff (793B - text/x-patch - Patches 5 to 8 of eight total)
file #44726:  0006-ax_cflags_warn_all.m4-Bug-fix-modern-Intel-compilers.patch added by zaitseff (888B - text/x-patch - Patches 5 to 8 of eight total)
file #44727:  0007-ax_prepend_flag.m4-New-macro-AX_PREPEND_FLAG.patch added by zaitseff (3KiB - text/x-patch - Patches 5 to 8 of eight total)
file #44728:  0008-ax_cflags_warn_all.m4-Prepend-flags-instead-of-appen.patch added by zaitseff (2KiB - text/x-patch - Patches 5 to 8 of eight total)
file #44721:  0001-ax_cflags_warn_all.m4-Bump-version-number-and-add-ne.patch added by zaitseff (1KiB - text/x-patch - Patches 1 to 4 of eight total)
file #44722:  0002-ax_cflags_warn_all.m4-Rewrite-AX_FLAGS_WARN_ALL-to-u.patch added by zaitseff (5KiB - text/x-patch - Patches 1 to 4 of eight total)
file #44723:  0003-ax_cflags_warn_all.m4-Nicely-indent-remaining-macros.patch added by zaitseff (1KiB - text/x-patch - Patches 1 to 4 of eight total)
file #44724:  0004-ax_cflags_warn_all.m4-Rewrite-the-documentation-to-p.patch added by zaitseff (3KiB - text/x-patch - Patches 1 to 4 of eight total)

 

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 zaitseff (Submitted the item)
  •  

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-14 simons StatusNone Done
        Open/ClosedOpen Closed
    2018-08-06 zaitseff Attached File- Added 0009-ax_cflags_warn_all.m4-Avoid-prepending-empty-flags.patch, #44731
    2018-08-06 zaitseff Attached File- Added 0005-ax_cflags_warn_all.m4-Bug-fix-the-PGI-compilers-do-n.patch, #44725
        Attached File- Added 0006-ax_cflags_warn_all.m4-Bug-fix-modern-Intel-compilers.patch, #44726
        Attached File- Added 0007-ax_prepend_flag.m4-New-macro-AX_PREPEND_FLAG.patch, #44727
        Attached File- Added 0008-ax_cflags_warn_all.m4-Prepend-flags-instead-of-appen.patch, #44728
    2018-08-06 zaitseff Attached File- Added 0001-ax_cflags_warn_all.m4-Bump-version-number-and-add-ne.patch, #44721
        Attached File- Added 0002-ax_cflags_warn_all.m4-Rewrite-AX_FLAGS_WARN_ALL-to-u.patch, #44722
        Attached File- Added 0003-ax_cflags_warn_all.m4-Nicely-indent-remaining-macros.patch, #44723
        Attached File- Added 0004-ax_cflags_warn_all.m4-Rewrite-the-documentation-to-p.patch, #44724

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code