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: Support for %d$c format specifier in diagnostics.c


"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 */


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