Er ... does port/snprintf.c actually work? - Mailing list pgsql-hackers

From Tom Lane
Subject Er ... does port/snprintf.c actually work?
Date
Msg-id 9381.1133723848@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
I started to do some simple testing of snprintf.c after doing the
cleanup work I had in mind, and soon found that neither my version
nor the original actually do parameter reordering correctly:

$ ./testf 'abc%2$sfoo%1$s' DEF GHI
sys:
abcGHIfooDEF            <--- looks right to me
ours:
abcDEFfooGHI            <--- wrong
done

I haven't dug into this too closely yet (offhand I think the problem
is that the loop at line 541ff is searching fmtpar[] and then using
fmtparptr[]) but was wondering why it hadn't been noticed before.
Which of our platforms actually use port/snprintf.c, and hasn't anyone
tried any of the internationalized message databases on one?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Paul Lindner
Date:
Subject: MIN() performance regression 8.0 -> 8.1
Next
From: Kevin Brown
Date:
Subject: Re: Reducing relation locking overhead