merge from gcc

This commit is contained in:
DJ Delorie 2004-09-05 06:04:05 +00:00
parent 0a7a5cb71d
commit c558f8950e
3 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2004-09-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ansidecl.h (ATTRIBUTE_SENTINEL): Define.
* libiberty.h (concat, reconcat, concat_length, concat_copy,
concat_copy2): Use ATTRIBUTE_SENTINEL.
2004-08-13 Alan Modra <amodra@bigpond.net.au> 2004-08-13 Alan Modra <amodra@bigpond.net.au>
* bfdlink.h (struct bfd_link_callbacks): Remove "error_handler". * bfdlink.h (struct bfd_link_callbacks): Remove "error_handler".

View File

@ -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) # define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)
#endif /* ATTRIBUTE_NULL_PRINTF */ #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 /* We use __extension__ in some places to suppress -pedantic warnings
about GCC extensions. This feature didn't work properly before about GCC extensions. This feature didn't work properly before
gcc 2.8. */ gcc 2.8. */

View File

@ -93,7 +93,7 @@ extern char *lrealpath PARAMS ((const char *));
the last argument of this function, to terminate the list of the last argument of this function, to terminate the list of
strings. Allocates memory using xmalloc. */ strings. Allocates memory using xmalloc. */
extern char *concat PARAMS ((const char *, ...)) ATTRIBUTE_MALLOC; extern char *concat PARAMS ((const char *, ...)) ATTRIBUTE_MALLOC ATTRIBUTE_SENTINEL;
/* Concatenate an arbitrary number of strings. You must pass NULL as /* Concatenate an arbitrary number of strings. You must pass NULL as
the last argument of this function, to terminate the list of the last argument of this function, to terminate the list of
@ -102,27 +102,27 @@ extern char *concat PARAMS ((const char *, ...)) ATTRIBUTE_MALLOC;
pointer to be freed after the new string is created, similar to the pointer to be freed after the new string is created, similar to the
way xrealloc works. */ way xrealloc works. */
extern char *reconcat PARAMS ((char *, const char *, ...)) ATTRIBUTE_MALLOC; extern char *reconcat PARAMS ((char *, const char *, ...)) ATTRIBUTE_MALLOC ATTRIBUTE_SENTINEL;
/* Determine the length of concatenating an arbitrary number of /* Determine the length of concatenating an arbitrary number of
strings. You must pass NULL as the last argument of this function, strings. You must pass NULL as the last argument of this function,
to terminate the list of strings. */ to terminate the list of strings. */
extern unsigned long concat_length PARAMS ((const char *, ...)); extern unsigned long concat_length PARAMS ((const char *, ...)) ATTRIBUTE_SENTINEL;
/* Concatenate an arbitrary number of strings into a SUPPLIED area of /* Concatenate an arbitrary number of strings into a SUPPLIED area of
memory. You must pass NULL as the last argument of this function, memory. You must pass NULL as the last argument of this function,
to terminate the list of strings. The supplied memory is assumed to terminate the list of strings. The supplied memory is assumed
to be large enough. */ to be large enough. */
extern char *concat_copy PARAMS ((char *, const char *, ...)); extern char *concat_copy PARAMS ((char *, const char *, ...)) ATTRIBUTE_SENTINEL;
/* Concatenate an arbitrary number of strings into a GLOBAL area of /* Concatenate an arbitrary number of strings into a GLOBAL area of
memory. You must pass NULL as the last argument of this function, memory. You must pass NULL as the last argument of this function,
to terminate the list of strings. The supplied memory is assumed to terminate the list of strings. The supplied memory is assumed
to be large enough. */ to be large enough. */
extern char *concat_copy2 PARAMS ((const char *, ...)); extern char *concat_copy2 PARAMS ((const char *, ...)) ATTRIBUTE_SENTINEL;
/* This is the global area used by concat_copy2. */ /* This is the global area used by concat_copy2. */