public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Diagnostic format of warnings
@ 2020-08-10 11:51 Licht, Martin
  2020-08-10 15:10 ` Martin Sebor
  0 siblings, 1 reply; 2+ messages in thread
From: Licht, Martin @ 2020-08-10 11:51 UTC (permalink / raw)
  To: gcc-help

Hello,

I have got a question regarding diagnostic output in GCC.

It seems that some diagnostic messages receive a color markup on my shell whereas others don't. For example, the word "warning" is purple for -Wfloat-equal whereas for -Winline it is not.

My guess is that some warnings happen before code generation (such as -Wfloat-equal) whereas other warnings happen after code generation (such as -Winline) and thus are treated differently.

I am wondering that is the intentional default on the GCC. It seems rather arbitrary to use such different formats for warnings.

Thanks & best regards,

Martin

http://www.math.ucsd.edu/~mlicht/

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

* Re: Diagnostic format of warnings
  2020-08-10 11:51 Diagnostic format of warnings Licht, Martin
@ 2020-08-10 15:10 ` Martin Sebor
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Sebor @ 2020-08-10 15:10 UTC (permalink / raw)
  To: Licht, Martin, gcc-help

On 8/10/20 5:51 AM, Licht, Martin via Gcc-help wrote:
> Hello,
> 
> I have got a question regarding diagnostic output in GCC.
> 
> It seems that some diagnostic messages receive a color markup on my shell whereas others don't. For example, the word "warning" is purple for -Wfloat-equal whereas for -Winline it is not.
> 
> My guess is that some warnings happen before code generation (such as -Wfloat-equal) whereas other warnings happen after code generation (such as -Winline) and thus are treated differently.
> 
> I am wondering that is the intentional default on the GCC. It seems rather arbitrary to use such different formats for warnings.

Diagnostics should be colorized regardless of when they are issued
(by the front end, during optimization, or expansion). I think I've
seen them lose color in older versions of GCC and during LTO but
I think that was fixed.  If it persists with newer versions of GCC
or happens under some other conditions we would need to see a test
case that reproduces it to say much more.

Martin

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

end of thread, other threads:[~2020-08-10 15:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10 11:51 Diagnostic format of warnings Licht, Martin
2020-08-10 15:10 ` Martin Sebor

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