From 8d30a9e919676913a7c5c33b7bff8a00c70cecbf Mon Sep 17 00:00:00 2001 From: stefanf Date: Thu, 26 Jan 2006 20:53:40 +0000 Subject: Analogous to __printflike and __scanflike, add the macro __format_arg which expands to the GCC format_arg attribute if supported. This fixes a syntax error in for compilers/tools not implementing the GCC __attribute__ extensions. --- include/nl_types.h | 3 +-- include/stdio.h | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/nl_types.h b/include/nl_types.h index 349fd77..e386568 100644 --- a/include/nl_types.h +++ b/include/nl_types.h @@ -97,8 +97,7 @@ typedef __nl_item nl_item; __BEGIN_DECLS nl_catd catopen(const char *, int); -char *catgets(nl_catd, int, int, const char *) - __attribute__((__format_arg__(4))); +char *catgets(nl_catd, int, int, const char *) __format_arg(4); int catclose(nl_catd); __END_DECLS diff --git a/include/stdio.h b/include/stdio.h index 8ff084d..d25f02c 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -328,12 +328,7 @@ char *tempnam(const char *, const char *); int asprintf(char **, const char *, ...) __printflike(2, 3); char *ctermid_r(char *); char *fgetln(FILE *, size_t *); -#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3 -#define __ATTR_FORMAT_ARG __attribute__((__format_arg__(2))) -#else -#define __ATTR_FORMAT_ARG -#endif -__const char *fmtcheck(const char *, const char *) __ATTR_FORMAT_ARG; +__const char *fmtcheck(const char *, const char *) __format_arg(2); int fpurge(FILE *); void setbuffer(FILE *, char *, int); int setlinebuf(FILE *); -- cgit v1.1