Is there a list of the minimum version of gcc that supports each __attribute__?

The official documentation shows only the minimum required version for a very small number of attributes:

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

Is there a complete list of the version in which each attribute was added? Even better would be a list that also shows which ones are compatible with pcc and tcc.

+3
source share
3 answers

gcc glib gmacros.h: http://git.gnome.org/browse/glib/tree/glib/gmacros.h

GLib, G_GNUC_NORETURN - __attribute__.

, HAVE_GCC_ATTRIBUTE_NORETURN, , YAGNI, .

+1

.

, / (, autoconf... () - , CMake), .

( autoconf), , __attribute__, , , . HAVE_GCC_ATTRIBUTE_XXX config.h, .

Then use this macro with #ifdefto check whether to place the attribute in the function or not, or perhaps use another hack to emulate the absence of the attribute.

0
source

Source: https://habr.com/ru/post/1794285/


All Articles