public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* How to dump all the warning/error messages list from gcc compiler?
@ 2012-11-16 19:43 Xiaopi Liu
  2012-11-16 22:24 ` Ian Lance Taylor
  0 siblings, 1 reply; 6+ messages in thread
From: Xiaopi Liu @ 2012-11-16 19:43 UTC (permalink / raw)
  To: gcc-help

Is it possible to dump all the compiler supported warning/error
messages list for gcc?
I am using gcc 4.4.5.
I searched the mailing list, but can not find a way.
Appreciate all the help.


If i post it at wrong place. Please also help point out.


-- 

Best wishes!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to dump all the warning/error messages list from gcc compiler?
  2012-11-16 19:43 How to dump all the warning/error messages list from gcc compiler? Xiaopi Liu
@ 2012-11-16 22:24 ` Ian Lance Taylor
       [not found]   ` <CAK-=+J-9FB30+YFzDY7_LgHBV8D4h0kC1RZFsgf0SECCRYZrag@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Lance Taylor @ 2012-11-16 22:24 UTC (permalink / raw)
  To: Xiaopi Liu; +Cc: gcc-help

On Fri, Nov 16, 2012 at 11:43 AM, Xiaopi Liu <liuxiaopi349@gmail.com> wrote:
> Is it possible to dump all the compiler supported warning/error
> messages list for gcc?

There is no simple way to do this, no.

You can grep the source code for "warning (" and "error (" and
warning_at and error_at.

Ian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to dump all the warning/error messages list from gcc compiler?
       [not found]     ` <CAKOQZ8wTyOP=oxRJ_bbof9aesCaN5TiFk+m3ivy68VPo9cRiow@mail.gmail.com>
@ 2012-11-18  9:39       ` Xiaopi Liu
  2012-11-19  3:14         ` Ian Lance Taylor
  0 siblings, 1 reply; 6+ messages in thread
From: Xiaopi Liu @ 2012-11-18  9:39 UTC (permalink / raw)
  To: gcc-help

Excuse me for the mis-operation. It is the first time to ask question here.
When I said a unique id corresponding to a warning message, I actually
refer to some other compiler,  like intel compiler.
The warning/remark reported in compiling by using intel compiler has a
corresponding id (a number) for that message.


For GCC, I am now trying to use -fdiagnostics-show-option to show the
diagnostics which can be used to disable that kind of warning message.
I mean I can use Wunused-parameter as unique "id" (not necessarily a number)
for the following kind of message.
main.cpp:7: warning: unused parameter ‘argc’ [-Wunused-parameter]


I assume that each warning message by GCC can be turned off its
corresponding unique diagnostics, and so uniquely identified by that
diagnostics.
Do you agree with this?

2012/11/18 Ian Lance Taylor <iant@google.com>:
> On Fri, Nov 16, 2012 at 5:33 PM, Xiaopi Liu <liuxiaopi349@gmail.com> wrote:
>> okay. Thanks.
>> Then how can we dump the id with that unique warning message in compiling?
>>
>> I want to do statistics how many kinds of warning message being
>> reported and reported how many times for each warning.
>
>
> Please reply to the mailing list, not just to me.  Thanks.
>
> I don't know what you mean by "the id with that unique warning
> message."  Are you talking about something that you think exists
> today?  Or are you talking about something that you think ought to
> exist?  Because as far as I know, there is no such unique id.
>
> Ian



-- 


Best wishes!
Sincerely yours, Xiaopi LIU

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to dump all the warning/error messages list from gcc compiler?
  2012-11-18  9:39       ` Xiaopi Liu
@ 2012-11-19  3:14         ` Ian Lance Taylor
  2012-11-19  3:54           ` Xiaopi Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Lance Taylor @ 2012-11-19  3:14 UTC (permalink / raw)
  To: Xiaopi Liu; +Cc: gcc-help

On Sun, Nov 18, 2012 at 1:39 AM, Xiaopi Liu <liuxiaopi349@gmail.com> wrote:
> Excuse me for the mis-operation. It is the first time to ask question here.
> When I said a unique id corresponding to a warning message, I actually
> refer to some other compiler,  like intel compiler.
> The warning/remark reported in compiling by using intel compiler has a
> corresponding id (a number) for that message.
>
>
> For GCC, I am now trying to use -fdiagnostics-show-option to show the
> diagnostics which can be used to disable that kind of warning message.
> I mean I can use Wunused-parameter as unique "id" (not necessarily a number)
> for the following kind of message.
> main.cpp:7: warning: unused parameter ‘argc’ [-Wunused-parameter]
>
>
> I assume that each warning message by GCC can be turned off its
> corresponding unique diagnostics, and so uniquely identified by that
> diagnostics.
> Do you agree with this?

I think that would be nice, but it turns out not to be the case.  A
single GCC warning option may control many options, so the option name
is not unique.  Many GCC warning options are not controlled by any
option, so the option name is not comprehensive.

Ian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to dump all the warning/error messages list from gcc compiler?
  2012-11-19  3:14         ` Ian Lance Taylor
@ 2012-11-19  3:54           ` Xiaopi Liu
  2012-11-19  9:00             ` Ángel González
  0 siblings, 1 reply; 6+ messages in thread
From: Xiaopi Liu @ 2012-11-19  3:54 UTC (permalink / raw)
  To: gcc-help

That is too bad for me.
So let me make the conclusion.
We have no solution for it , I mean dumping info,  like a unique 'id'
for each warning message from GCC,   at least for now.
Thanks for all your help.


2012/11/19 Ian Lance Taylor <iant@google.com>
>
> On Sun, Nov 18, 2012 at 1:39 AM, Xiaopi Liu <liuxiaopi349@gmail.com> wrote:
> > Excuse me for the mis-operation. It is the first time to ask question here.
> > When I said a unique id corresponding to a warning message, I actually
> > refer to some other compiler,  like intel compiler.
> > The warning/remark reported in compiling by using intel compiler has a
> > corresponding id (a number) for that message.
> >
> >
> > For GCC, I am now trying to use -fdiagnostics-show-option to show the
> > diagnostics which can be used to disable that kind of warning message.
> > I mean I can use Wunused-parameter as unique "id" (not necessarily a number)
> > for the following kind of message.
> > main.cpp:7: warning: unused parameter ‘argc’ [-Wunused-parameter]
> >
> >
> > I assume that each warning message by GCC can be turned off its
> > corresponding unique diagnostics, and so uniquely identified by that
> > diagnostics.
> > Do you agree with this?
>
> I think that would be nice, but it turns out not to be the case.  A
> single GCC warning option may control many options, so the option name
> is not unique.  Many GCC warning options are not controlled by any
> option, so the option name is not comprehensive.
>
> Ian




--


Best wishes!
Sincerely yours, Xiaopi LIU

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to dump all the warning/error messages list from gcc compiler?
  2012-11-19  3:54           ` Xiaopi Liu
@ 2012-11-19  9:00             ` Ángel González
  0 siblings, 0 replies; 6+ messages in thread
From: Ángel González @ 2012-11-19  9:00 UTC (permalink / raw)
  To: Xiaopi Liu; +Cc: gcc-help

On 19/11/12 04:54, Xiaopi Liu wrote:
> That is too bad for me.
> So let me make the conclusion.
> We have no solution for it , I mean dumping info,  like a unique 'id'
> for each warning message from GCC,   at least for now.
> Thanks for all your help.
Maybe you could use the text of the message in a fixed language (eg.
LANG=C),
and strip anything inside quotes ?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-19  9:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-16 19:43 How to dump all the warning/error messages list from gcc compiler? Xiaopi Liu
2012-11-16 22:24 ` Ian Lance Taylor
     [not found]   ` <CAK-=+J-9FB30+YFzDY7_LgHBV8D4h0kC1RZFsgf0SECCRYZrag@mail.gmail.com>
     [not found]     ` <CAKOQZ8wTyOP=oxRJ_bbof9aesCaN5TiFk+m3ivy68VPo9cRiow@mail.gmail.com>
2012-11-18  9:39       ` Xiaopi Liu
2012-11-19  3:14         ` Ian Lance Taylor
2012-11-19  3:54           ` Xiaopi Liu
2012-11-19  9:00             ` Ángel González

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).