This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: intl patches (21)


On Mon, 23 Jul 2001, Bruno Haible wrote:

> But since the msgid1 is used only for the English singular form, i.e. when
> n == 1, it is customary to omit the %d representation from this format string.
> The printf call should be checked against msgid2, the plural form,
> instead. With the patch below, the above code compiles without warnings.

The correct solution is to specify both format_arg attributes.  At present
the last one specified will silently override the previous ones - but once
I've implemented getting these attributes attached to the function type,
with multiple attributes allowed, checking against both of them will start
working, using the support already present in GCC 3 for checking both
branches of a conditional expression - and this will suppress the warning
about extra arguments if it occurs in some but not all branches.  (So you
want both format_arg attributes present on each declaration, with the
plural one listed last so that it is the one used by current GCC.)

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]