> diff --git a/libibcommon/include/infiniband/common.h > b/libibcommon/include/infiniband/common.h > index 83c0679..66afab0 100644 > --- a/libibcommon/include/infiniband/common.h > +++ b/libibcommon/include/infiniband/common.h > @@ -114,11 +114,16 @@ #endif > #define ENUM_STR_DEF(enumname, last, val) (((unsigned)(val) < last) ? > enumname ## _str[val] : "???") > #define ENUM_STR_ARRAY(name) char * name ## _str[] > > +#ifdef __GNUC__ > +#define STRICT_FORMAT __attribute__((format(printf, 2, 3))) > +#else > +#define STRICT_FORMAT > +#endif
You are polluting the global namespace - macros must be prefixed with library name. But anyway - why is this necessary? Does anyone actually try compiling libibcommon not in gcc? Why? And AFAIK e.g. intel compiler implements this __attribute__. > /* util.c: debugging and tracing */ > -void ibwarn(const char * const fn, char *msg, ...); > -void ibpanic(const char * const fn, char *msg, ...); > -void logmsg(const char *const fn, char *msg, ...); > +void ibwarn(const char * const fn, char *msg, ...) STRICT_FORMAT; > +void ibpanic(const char * const fn, char *msg, ...) STRICT_FORMAT; > +void logmsg(const char *const fn, char *msg, ...) STRICT_FORMAT; > > void xdump(FILE *file, char *msg, void *p, int size); -- MST _______________________________________________ openib-general mailing list [email protected] http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
