text: This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.
  On Fri, May 23, 2014 at 07:34:57PM +0200, OndÅej BÃlka wrote: > On Fri, May 23, 2014 at 07:53:11AM -0700, Paul Eggert wrote: > > OndÅej BÃlka wrote: > > >CCing gnulib. Could this be backported also there or do you have > > >different solution? > > > > We solved this problem in a different way years ago, using something > > like this: > > > > #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR >= 7) > > # define _GL_ATTRIBUTE_FORMAT(s) __attribute__ ((__format__ s)) > > #else > > # define _GL_ATTRIBUTE_FORMAT(s) > > #endif > > > > and then using _GL_ATTRIBUTE_FORMAT ((__printf__, 2, 3)) later, > > instead of __attribute__ ((__format__ (__printf__, 2, 3))). > > Presumably glibc could do something similar. Glibc could use a > > different name; that's all right, gnulib will just switch to the > > name that glibc uses. > > Ok, here is patch that does that with unchanged name (Does somebody have > better one?). > > As I looked at header differences they are mostly minor, like using > `foo' instead "foo" in comments so it migth be worthwhile to sync them > up. > > > * argp/argp-fmtstream.h (_GL_ATTRIBUTE_FORMAT): Define. > (argp_error, argp_failure): Use _GL_ATTRIBUTE_FORMAT. > * argp/argp.h (__argp_fmtstream_printf): Likewise. Thanks for working on this issue. The patch looks fine to me, and I have just tested it, it fixes the original issue. Please also note that your patch doesn't apply cleanly, it seems there are some issue with the context. > @@ -521,12 +546,12 @@ > extern void argp_failure (const struct argp_state *__restrict __state, > int __status, int __errnum, > const char *__restrict __fmt, ...) > - __attribute__ ((__format__ (__printf__, 4, 5))); > + _GL_ATTRIBUTE_FORMAT ((__printf__, 4, 5)); > extern void __argp_failure (const struct argp_state *__restrict __state, > 7int __status, int __errnum, Especially there with this extra "7". -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net