This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #16907] Sync argp.h __attribute__ with gnulib.
- From: Aurelien Jarno <aurelien at aurel32 dot net>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Paul Eggert <eggert at cs dot ucla dot edu>, Will Newton <will dot newton at linaro dot org>, libc-alpha <libc-alpha at sourceware dot org>, bug-gnulib at gnu dot org
- Date: Tue, 3 Jun 2014 12:59:11 +0200
- Subject: Re: [PATCH][BZ #16907] Sync argp.h __attribute__ with gnulib.
- Authentication-results: sourceware.org; auth=none
- References: <20140518125743 dot GA11620 at domone dot podge> <CANu=Dmjb+Zwup9m7r4EXWx+VFO4HYDC1ifW08AQKjtJ0P4UUhA at mail dot gmail dot com> <20140523100038 dot GA15258 at domone dot podge> <537F60D7 dot 3060106 at cs dot ucla dot edu> <20140523173457 dot GA26513 at domone dot podge>
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 http://www.aurel32.net