This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Support for %d$c format specifier in diagnostics.c
- From: Ishikawa <ishikawa at yk dot rim dot or dot jp>
- To: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- Cc: Gabriel Dos Reis <gdr at integrable-solutions dot net>, Zack Weinberg <zack at codesourcery dot com>, Neil Booth <neil at daikokuya dot co dot uk>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 21 Jul 2003 08:35:56 +0900
- Subject: Re: Support for %d$c format specifier in diagnostics.c
- References: <m19WKhW-000H3mC@standard.erephon> <20030628193135.GA1767@daikokuya.co.uk> <87llvlk3gi.fsf@egil.codesourcery.com> <3EFE65DC.52576EC7@yk.rim.or.jp> <87vfupiglu.fsf@egil.codesourcery.com> <3EFEE0EF.C560ED1A@yk.rim.or.jp> <87isqoiwng.fsf@egil.codesourcery.com> <3F061172.814BA7A0@yk.rim.or.jp> <Pine.LNX.4.56.0307051127540.6302@kern.srcf.societies.cam.ac.uk> <3F0CA938.1FA02D3E@yk.rim.or.jp> <m3vfuayizy.fsf@uniton.integrable-solutions.net> <3F1A1654.4476090C@yk.rim.or.jp> <Pine.LNX.4.56.0307201539320.2839@kern.srcf.societies.cam.ac.uk>
"Joseph S. Myers" wrote:
>
> On Sun, 20 Jul 2003, Ishikawa wrote:
>
> > BTW, Does anyone use the format_decoder function?
> > (It looks that a format_decoder, c_tree_printer in
> > c-objc-common.c, is used. But it seems to be used for
> > internal compiler diagnostics and so we don't need to
> > use positional parameter with it. So we don't lose if I am not
> > mistaken.)
>
> It is extensively used by the C++ front end, and now extensively used by
> the C front end after Gaby's removal of usage of warning_with_decl etc. -
> it is clearly necessary to handle usages such as %2$D. In fact you will
> see that the Turkish language translation already has usages such as %3$T.
> You'll probably need to split the interface for custom decoders into
> separate parts to decode the type wanted and store type information; to
> extract the argument value from the variable arguments; and to print that
> previously extracted value.
Thank you for the feedback.
Now I have a few questions that I hope someone can clear up.
1. Which CVS version should I be working on? Currently,
I have used 3.3 branch CVS since gcc 3.3 had an issue
which brought me into analyzing the problem by looking at
at the source files.
2. Even under 3.3 branch, I found that Turkish po file
uses ALREADY(!) the positional prameters.
(But not 'T' as in %3$T. Was it meant to be 'D' as in %3D?
Maybe in newer release?)
While this illustrates the necessity of positional paramaters
for I18N/L10N work, I think something is wrong here since
the released GCC diagnostic doesn't support the positional parameter.
I am wondering if Turkish people got the right diagnostic messages
with 3.3 under appropriate environment setting.
3. > You'll probably need to split the interface for custom decoders
into
> separate parts
> to decode the type wanted and store type information;
> to extract the argument value from the variable arguments;
> and to print that previously extracted value.
(I re-indented the quote. )
This is exactly what the support for positional parameters needs to
do.
(All the more reason why I am puzzled if the latest Turkish po file
in newer CVS branches already has %3$D, etc.. Or is it the case that
the installed decoder itself handles the positional parameter???)
Do people already have an idea on the appropriate APIs?
Or can I concoct something on the fly and prpose it in the patch?
4. Again, assuming that I need to fetch the latest CVS branch
(whichever is appropriate), which file(s) should I read to
learn the usage of custom decoders for C++ and C.
(Especially C++. I have not used g++ much and so am not familiar with
g++ source file structure.)
Thank you in advance for your attention.
Happy Hacking,
Ishikawa, Chiaki
--
int main(void){int j=2003;/*(c)2003 cishikawa. */
char t[] ="<CI> @abcdefghijklmnopqrstuvwxyz.,\n\"";
char *i ="g>qtCIuqivb,gCwe\np@.ietCIuqi\"tqkvv is>dnamz";
while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1),
(putchar(t[j])));return 0;}/* under GPL */