patchGNU Autoconf Archive - Patches: patch #8260, Macros to check GCC-compatible...

 
 

patch #8260: Macros to check GCC-compatible built-in functions, function and variable attributes

Submitter:  None
Submitted:  Mon 16 Dec 2013 04:28:54 PM UTC
   
 
Priority:  5 - Normal Status:  Done
Assigned to:  simons Originator Email:  -email is unavailable-
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 19 Dec 2013 07:31:51 PM UTC, comment #1: 

I've pushed these submissions in cba04c6..bd4346f. Thank you very much for the patch!

Peter Simons <simons>
Group administrator
Mon 16 Dec 2013 04:28:54 PM UTC, original submission:  

This patch-set adds three macros:

- AX_GCC_BUILTIN(BUILTIN)

This macro is used to detect GCC-compatible built-in functions (e.g. AX_GCC_BUILTIN([__builtin_expect]) to check for __builtin_expect()). Since those functions are not treated like normal functions they cannot be checked using common autoconf macros. The macro description contains the relatively long list of supported built-ins; unknown built-ins can also be checked but the result might be wrong or meaningless, the user will be warned in this case.

- AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE)

This macro is used to detect GCC-compatible function attributes (e.g. AX_GCC_FUNC_ATTRIBUTE([pure]) to check for _attribute_((pure))). Using invalid or unknown attributes usually generates warnings instead of compiler errors hence this macro provides proper attribute-specific checks to ensure that the required attribute is correctly supported. The macro header contains the list of supported attributes. Unknown attributes can also be checked but the result might be wrong or meaningless, the user will be warned in this case

- AX_GCC_VAR_ATTRIBUTE(ATTRIBUTE)

This macro is used to detect GCC-compatible variable attributes (e.g. AX_GCC_VAR_ATTRIBUTE([unused]) to check for _attribute_((unused))). It works in the same way as the previous one.

The macros all define HAVE_* macros when the checked builtin/attribute is found and also properly set ax_cv_have_* variables. They have been tested across multiple versions of GCC and LLVM/clang to ensure that they detect the available builtins/attributes correctly.

Finally all macros are available under the all-permissive license.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

 

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

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-07 simons StatusReady For Test Done
        Open/ClosedOpen Closed
    2013-12-19 simons StatusNone Ready For Test
        Assigned toNone simons
    2013-12-16 None Attached File- Added 0001-Add-a-macro-for-checking-GCC-compatible-built-in-fun.patch, #29974
        Attached File- Added 0003-Add-a-macro-to-check-GCC-compatible-variable-attribu.patch, #29975
        Attached File- Added 0002-Add-a-macro-for-checking-GCC-compatible-function-att.patch, #29976

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code