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


Ishikawa <ishikawa@yk.rim.or.jp> writes:

| "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.

Please mainline, don't specify any tag.  See instruction at 

      http://gcc.gnu.org/cvs.html

| 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?)

I don't know.  But I'm sure something like %3D does not make sense 
within the diagnostic framework.

|    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?

I'm not sure I understand that question, couold you elaborate?

|    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.)

the C++ format decoder is in cp/error.c, but beware: that is
spaghetti code.  

I don't think you need to understand the code there.  What you need
(I think) is to convince output_format to give you the string you get
by formatting a tree, remember it for latter use.   

-- Gaby


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