diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-30 00:04:09 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-30 00:04:09 +0000 |
commit | 1b52004c4e27cac44a4d35725923708c824b6dba (patch) | |
tree | 1a3d7e51d55a91816209442f10b9808b15055c06 /include | |
parent | 4133d091f4d6bec891da26550dd256036c9a53b2 (diff) | |
download | gcc-1b52004c4e27cac44a4d35725923708c824b6dba.tar.gz |
* ansidecl.h: Add ATTRIBUTE_FPTR_PRINTF.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100334 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/ansidecl.h | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 0eb2b090d15..bac0eb3d224 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2005-05-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * ansidecl.h: Add ATTRIBUTE_FPTR_PRINTF. + 2005-05-28 Eli Zaretskii <eliz@gnu.org> * libiberty.h: (snprintf) [!HAVE_DECL_SNPRINTF]: Declare if diff --git a/include/ansidecl.h b/include/ansidecl.h index 380e7b35114..439431182dc 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -312,6 +312,22 @@ So instead we use the macro below and test it against specific values. */ #define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) #endif /* ATTRIBUTE_PRINTF */ +/* Use ATTRIBUTE_FPTR_PRINTF when the format attribute is to be set on + a function pointer. Format attributes were allowed on function + pointers as of gcc 3.1. */ +#ifndef ATTRIBUTE_FPTR_PRINTF +# if (GCC_VERSION >= 3001) +# define ATTRIBUTE_FPTR_PRINTF(m, n) ATTRIBUTE_PRINTF(m, n) +# else +# define ATTRIBUTE_FPTR_PRINTF(m, n) +# endif /* GNUC >= 3.1 */ +# define ATTRIBUTE_FPTR_PRINTF_1 ATTRIBUTE_FPTR_PRINTF(1, 2) +# define ATTRIBUTE_FPTR_PRINTF_2 ATTRIBUTE_FPTR_PRINTF(2, 3) +# define ATTRIBUTE_FPTR_PRINTF_3 ATTRIBUTE_FPTR_PRINTF(3, 4) +# define ATTRIBUTE_FPTR_PRINTF_4 ATTRIBUTE_FPTR_PRINTF(4, 5) +# define ATTRIBUTE_FPTR_PRINTF_5 ATTRIBUTE_FPTR_PRINTF(5, 6) +#endif /* ATTRIBUTE_FPTR_PRINTF */ + /* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A NULL format specifier was allowed as of gcc 3.3. */ #ifndef ATTRIBUTE_NULL_PRINTF |