diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-05 02:50:09 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-05 02:50:09 +0000 |
commit | bf6c8de0ca844fe49b07d807047b6e648772c04b (patch) | |
tree | 616590e443b211fdf7309d929fce3872a4ff3f15 /include/ansidecl.h | |
parent | b1d422af2ac49ae61000c4377ba4a8ae8f7ca3e2 (diff) | |
download | gcc-bf6c8de0ca844fe49b07d807047b6e648772c04b.tar.gz |
gcc:
* builtin-attrs.def (ATTR_SENTINEL, ATTR_SENTINEL_NOTHROW_LIST):
New.
* builtins.def (BUILT_IN_EXECL, BUILT_IN_EXECLP): Add `sentinel'
attribute.
* c-common.c (handle_sentinel_attribute, check_function_sentinel):
New functions.
(c_common_attribute_table): Add `sentinel' attribute.
(check_function_arguments): Handle `sentinel' attribute.
* doc/extend.texi: Document `sentinel' attribute.
gcc/testsuite:
* gcc.dg/format/sentinel-1.c: New test.
include:
* ansidecl.h (ATTRIBUTE_SENTINEL): Define.
* libiberty.h (concat, reconcat, concat_length, concat_copy,
concat_copy2): Use ATTRIBUTE_SENTINEL.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87096 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include/ansidecl.h')
-rw-r--r-- | include/ansidecl.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/ansidecl.h b/include/ansidecl.h index ccf0b2757ae..04c3a30bb53 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -322,6 +322,15 @@ So instead we use the macro below and test it against specific values. */ # define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6) #endif /* ATTRIBUTE_NULL_PRINTF */ +/* Attribute `sentinel' was valid as of gcc 3.5. */ +#ifndef ATTRIBUTE_SENTINEL +# if (GCC_VERSION >= 3005) +# define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__)) +# else +# define ATTRIBUTE_SENTINEL +# endif /* GNUC >= 3.5 */ +#endif /* ATTRIBUTE_SENTINEL */ + /* We use __extension__ in some places to suppress -pedantic warnings about GCC extensions. This feature didn't work properly before gcc 2.8. */ |