This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/7765 [Patch]


On Tue, Nov 05, 2002 at 08:58:00AM +0200, Kai Henningsen wrote:
> bangerth@ticam.utexas.edu (Wolfgang Bangerth)  wrote on 28.10.02 in <Pine.LNX.4.44.0210281251240.736-100000@gandalf.ticam.utexas.edu>:
> 
> > > Yes, the order of formats must presently be preserved.  I realize that
> > > this interferes with proper translation.  What we need to do is
> > > implement the SVR4 "%1$x" printf extension: this allows you to write
> > >
> > >  msgid "statement about %d %s"
> > >  msgstr "statement about %2$s in quantity %1$d"
> > >
> > > (I will get to this eventually, but the list of things I will get to
> > > eventually has items on it from 1998, so don't hold your breath.
> > > Patches for diagnostic.c are welcome.)
> >
> > Doing this first, before cleaning up what is there now, may be even
> > the simpler way: about 1000 (half of the total) are ordering problems.
> > These could, to a large extent, probably be fixed if the SVR4 syntax would
> > be there, without even knowing the language in question. Maybe even
> > semiautomatically.
> 
> Unfortunately, that's not exactly trivial. Maybe one could steal the  
> relevant code from glibc?
> 
> Essentially, one would have to first build up a list of all specifiers in  
> the format string, hope that that gives no holes with unused parameters in  
> them where one does not know their type, then process the varargs with the  
> type info one has into that list, and finally do another pass to output  
> the whole mess - first and third pass in format string sequence, second  
> pass in argument sequence.

I'm working on just this.  It may take me awhile - it is indeed
nonobvious, and I don't intend to recycle the glibc code because it's
just too messy.

It may well be too invasive for 3.3 - we'll see.

zw


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