[Bug driver/78787] O Color, Where Art Thou? (with -flto)

2016-12-15 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78787

--- Comment #4 from David Malcolm  ---
(In reply to David Malcolm from comment #3)
> Created attachment 40343 [details]
> Hack to debug diagnostic-color.c

$ ./xgcc -B. -O2 -Wall -Wextra -flto /home/david/coding-3/gcc-git-clean/src/z.c
should_colorize: true (isatty (stderr))
should_colorize: true (isatty (stderr))
/home/david/coding-3/gcc-git-clean/src/z.c: In function ‘main’:
/home/david/coding-3/gcc-git-clean/src/z.c:3:27: warning: unused parameter
‘argv’ [-Wunused-parameter]
 int main (int argc, char *argv[])
   ^~~~
should_colorize: false (!isatty (stderr))
should_colorize: false (!isatty (stderr))
should_colorize: false (!isatty (stderr))
should_colorize: false (!isatty (stderr))
/home/david/coding-3/gcc-git-clean/src/z.c: In function ‘main’:
/home/david/coding-3/gcc-git-clean/src/z.c:5:3: warning: ‘__builtin_strcpy’
writing 4 bytes into a region of size 1 overflows the destination
[-Wstringop-overflow=]
   __builtin_strcpy (d, argc < 3 ? "123" : "456789");
   ^

So it appears that lto's stderr is not directly connected to a tty, and hence
there's no colorization by default.

[Bug driver/78787] O Color, Where Art Thou? (with -flto)

2016-12-15 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78787

David Malcolm  changed:

   What|Removed |Added

 CC||dmalcolm at gcc dot gnu.org

--- Comment #3 from David Malcolm  ---
Created attachment 40343
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40343=edit
Hack to debug diagnostic-color.c

[Bug driver/78787] O Color, Where Art Thou? (with -flto)

2016-12-13 Thread ssbssa at yahoo dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78787

Domani Hannes  changed:

   What|Removed |Added

 CC||ssbssa at yahoo dot de

--- Comment #2 from Domani Hannes  ---
Isn't the sub-command output redirected into a file?
Thus the terminal detection via isatty() in diagnostic-color.c doesn't work.