From: hno <> Date: Wed, 14 Nov 2001 04:27:47 +0000 (+0000) Subject: Not all versions of GCC is very happy about expressions in __attribute__ X-Git-Tag: SQUID_3_0_PRE1~1298 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68361fc46ac6a4e00fc3f9790af2c16bf8b60e91;p=thirdparty%2Fsquid.git Not all versions of GCC is very happy about expressions in __attribute__ definitions. (works, but complains a bit... looks like GCC bugs) /home/users/h/hn/hno/squid/src/protos.h:1068: syntax error, found `+' /home/users/h/hn/hno/squid/src/protos.h:1068: illegal function definition, found `)' cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode and then it works.. --- diff --git a/include/config.h b/include/config.h index 9b30a77da8..8f0f1d1153 100644 --- a/include/config.h +++ b/include/config.h @@ -1,5 +1,5 @@ /* - * $Id: config.h,v 1.3 2001/10/22 23:55:43 hno Exp $ + * $Id: config.h,v 1.4 2001/11/13 21:27:47 hno Exp $ * * AUTHOR: Duane Wessels * @@ -176,9 +176,13 @@ #endif #if __GNUC__ -#define PRINTF_FORMAT_ARG(pos) __attribute__ ((format (printf, pos, pos + 1))) +#define PRINTF_FORMAT_ARG1 __attribute__ ((format (printf, 1, 2))) +#define PRINTF_FORMAT_ARG2 __attribute__ ((format (printf, 2, 3))) +#define PRINTF_FORMAT_ARG3 __attribute__ ((format (printf, 3, 4))) #else -#define PRINTF_FORMAT_ARG(pos) +#define PRINTF_FORMAT_ARG1 +#define PRINTF_FORMAT_ARG2 +#define PRINTF_FORMAT_ARG3 #endif #endif /* SQUID_CONFIG_H */ diff --git a/include/snmp_debug.h b/include/snmp_debug.h index 03d937e211..4e8d683dc4 100644 --- a/include/snmp_debug.h +++ b/include/snmp_debug.h @@ -1,11 +1,11 @@ /* - * $Id: snmp_debug.h,v 1.9 2001/10/22 23:55:43 hno Exp $ + * $Id: snmp_debug.h,v 1.10 2001/11/13 21:27:47 hno Exp $ */ #ifndef SQUID_SNMP_DEBUG_H #define SQUID_SNMP_DEBUG_H extern void -snmplib_debug(int, const char *,...) PRINTF_FORMAT_ARG(2); +snmplib_debug(int, const char *,...) PRINTF_FORMAT_ARG2; #endif /* SQUID_SNMP_DEBUG_H */ diff --git a/src/protos.h b/src/protos.h index 6f7572288f..32ca2725cd 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.419 2001/10/22 23:55:43 hno Exp $ + * $Id: protos.h,v 1.420 2001/11/13 21:27:48 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -195,7 +195,7 @@ extern void packerClean(Packer * p); extern void packerAppend(Packer * p, const char *buf, int size); #if STDC_HEADERS extern void -packerPrintf(Packer * p, const char *fmt,...) PRINTF_FORMAT_ARG(2); +packerPrintf(Packer * p, const char *fmt,...) PRINTF_FORMAT_ARG2; #else extern void packerPrintf(); #endif @@ -210,7 +210,7 @@ extern void _db_rotate_log(void); #if STDC_HEADERS extern void -_db_print(const char *,...) PRINTF_FORMAT_ARG(1); +_db_print(const char *,...) PRINTF_FORMAT_ARG1; #else extern void _db_print(); #endif @@ -412,7 +412,7 @@ extern int httpHeaderParseSize(const char *start, ssize_t * sz); extern int httpHeaderReset(HttpHeader * hdr); #if STDC_HEADERS extern void -httpHeaderPutStrf(HttpHeader * hdr, http_hdr_type id, const char *fmt,...) PRINTF_FORMAT_ARG(3); +httpHeaderPutStrf(HttpHeader * hdr, http_hdr_type id, const char *fmt,...) PRINTF_FORMAT_ARG3; #else extern void httpHeaderPutStrf(); #endif @@ -610,7 +610,7 @@ extern void memBufAppend(MemBuf * mb, const char *buf, mb_size_t size); /* calls snprintf, extends buffer if needed */ #if STDC_HEADERS extern void -memBufPrintf(MemBuf * mb, const char *fmt,...) PRINTF_FORMAT_ARG(2); +memBufPrintf(MemBuf * mb, const char *fmt,...) PRINTF_FORMAT_ARG2; #else extern void memBufPrintf(); #endif @@ -918,7 +918,7 @@ extern void storeHashInsert(StoreEntry * e, const cache_key *); extern void storeSetMemStatus(StoreEntry * e, int); #if STDC_HEADERS extern void -storeAppendPrintf(StoreEntry *, const char *,...) PRINTF_FORMAT_ARG(2); +storeAppendPrintf(StoreEntry *, const char *,...) PRINTF_FORMAT_ARG2; #else extern void storeAppendPrintf(); #endif @@ -1065,7 +1065,7 @@ extern void death(int sig); extern void fatal(const char *message); #if STDC_HEADERS extern void -fatalf(const char *fmt,...) PRINTF_FORMAT_ARG(1); +fatalf(const char *fmt,...) PRINTF_FORMAT_ARG1; #else extern void fatalf(); #endif @@ -1191,7 +1191,7 @@ extern String stringDup(const String * s); extern void stringClean(String * s); extern void stringReset(String * s, const char *str); extern void stringAppend(String * s, const char *buf, int len); -/* extern void stringAppendf(String *s, const char *fmt, ...) PRINTF_FORMAT_ARG(2); */ +/* extern void stringAppendf(String *s, const char *fmt, ...) PRINTF_FORMAT_ARG2; */ /* * ipc.c @@ -1288,7 +1288,7 @@ extern void logfileWrite(Logfile * lf, void *buf, size_t len); extern void logfileFlush(Logfile * lf); #if STDC_HEADERS extern void -logfilePrintf(Logfile * lf, const char *fmt,...) PRINTF_FORMAT_ARG(2); +logfilePrintf(Logfile * lf, const char *fmt,...) PRINTF_FORMAT_ARG2; #else extern void logfilePrintf(va_alist); #endif