Aidan Van Dyk <ai...@highrise.ca> writes:
> From the glibc printf man page:
>    "There  may  be no gaps in the numbers of arguments specified using
>     '$'; for example, if arguments 1 and 3 are specified, argument 2 must
>     also be specified somewhere in the format string."

> So, is skipping 1 allowed?

No --- the point is that printf has to be able to figure out where each
argument is on the stack, so it must be able to infer the size of each
of the arguments from left to right.

> That said, I do think the "msgid" should be using the % args, not words
> for a few reasons:
> 1) Make it more clear for translators the arguments and their ordering
>    without having to visit the source code
> 2) On crufty systems without gettext, I wouldn't expect them to support m$
>    modifiers then either...
> 3) Greg's "these are numbers, not sentences" is how I expect the system
>    to work...

Actually, configure checks to see if the local printf supports m$ or
not, and we use our own printf implementation if not.  So I'm not
worried about #2.  I agree with your other points though.

(So, if you wanna see how this is done, try src/port/snprintf.c)

                        regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to