]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Not all versions of GCC is very happy about expressions in __attribute__
authorhno <>
Wed, 14 Nov 2001 04:27:47 +0000 (04:27 +0000)
committerhno <>
Wed, 14 Nov 2001 04:27:47 +0000 (04:27 +0000)
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..

include/config.h
include/snmp_debug.h
src/protos.h

index 9b30a77da896e5720aba34deeee44634347d4797..8f0f1d11534abc53e78bcd88b3dc97498835199a 100644 (file)
@@ -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
  *
 #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 */
index 03d937e211c476effe7a62266ca5342a5ac367ac..4e8d683dc4b4d13f013a24a28513e0a5967b9d68 100644 (file)
@@ -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 */
index 6f7572288f8d16ab1e05ada304a348b7998af46b..32ca2725cd3ddf0164694bb0b359f9a2811e880b 100644 (file)
@@ -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