This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Suppressing specific compiler warnings
- From: "Banibrata Dutta" <dutta at india dot hp dot com>
- To: <gcc at gcc dot gnu dot org>, <llewelly at xmission dot com>
- Cc: "'Ranjit Mathew'" <rmathew at gmail dot com>
- Date: Thu, 27 May 2004 10:22:44 +0530
- Subject: RE: Suppressing specific compiler warnings
Hi,
Thanks to you all for all the suggestions like...
i) DIY
ii) pay to contributor
etc.
Both make perfect sense, but what I understand from all the
mails is that this is a well-understood and well-thought of
issue, and obviously at the pit's bottom in the well-of-priorites :(
Inspite of this I think I owe a few clarifications:
1) Numbers are harder to remember for humans. Agreed. But I didn't
mean numbers alone, but Numbers "plus" Textual explanation of the
warning or error. It's like the ease of using real array indices or
working with associative arrays... Here, all I am saying is that to
a typical "C" programmer, arrays with integer indices may be simpler!!
(just the simple me).
2) The way numbers help internationalization is that you could have
something like:
wchar* warning_message[MAX_LANGS][MAX_WARNINGS];
populated with something like...
warning_message[LANG_EN][UNUSED_VAR] = "Unused variable";
warning_message[LANG_FR][UNUSED_VAR] = "Variable inutilisée";
..
warning_message[LANG_EN][STMT_NOT_REACHED] = "Statement not reached";
warning_message[LANG_FR][STMT_NOT_REACHED] = "Rapport non atteint";
..
and based on your internationalization setting i.e. current_lang == LANG_EN
(english) or == LANG_FR (french), automatically the correct warning is
displayed, in the following format...
printf("Warning %d: %s\n", warn_num,
warning_message[current_lang][warn_num]);
that's it.
As for the "Kid DIY"... I am seriously giving it a thought, but i need
to understand that proposal present no danger to the sanity and usability
of the code, for this i need "big bro's"... Anybody listening ?!
Thanks & regards,
Banibrata Dutta
> -----Original Message-----
> From: Phil Edwards [mailto:phil@codesourcery.com]
> Sent: Thursday, May 27, 2004 12:20 AM
> To: llewelly@xmission.com
> Cc: Banibrata Dutta; 'Ranjit Mathew'; gcc@gcc.gnu.org
> Subject: Re: Suppressing specific compiler warnings
>
>
> [I'm on the list, please don't cc me.]
>
>
> On Wed, May 26, 2004 at 01:17:36PM -0600, llewelly@xmission.com wrote:
> > >
> > > And then have option like -Wno-<number>... Something quite similar
> > > to the HP compilers!
> >
> > Numbers are for computers. Names for people. A generalization,
> > but I am opposed to numbering warning kinds, on the
> > grounds that numbers tend to be harder to remember. If you are
> > reading a makefile, and you see -Wno-1492, you have no clue why,
> > but if you see -Wno-unused you know what is going on.
>
> I tend to agree.
>
>
> > > Also, this would make the process of internationalization
> of gcc/g++
> > > easy.
> >
> > Pardon my ignorance, but how so?
>
> With numbers, the only string that needs to be translated is
> "no-". With names, they /all/ need meaningful translations.
>
> I still think names would be more appropriate.
>
>
> Phil
>
> --
> Behind everything some further thing is found, forever; thus
> the tree behind the bird, stone beneath soil, the sun behind
> Urth. Behind our efforts, let there be found our efforts.
> - Ascian saying, as related by Loyal to the
> Group of Seventeen
>