https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85433
Bug ID: 85433 Summary: -fdiagnostics-color=auto doesn't work properly with LTO Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: dmalcolm at gcc dot gnu.org Target Milestone: --- Running: $ cat 1.c struct A { int a; double b; }; extern void foo (struct A *); int main() { struct A a; foo (&a); return a.a; } $ cat 2.c struct A { int a; }; $ gcc *.c -fdiagnostics-color=auto -flto 1.c:7:13: warning: type of ‘foo’ does not match original declaration [-Wlto-type-mismatch] extern void foo (struct A *); ^ 2.c:7:6: note: ‘foo’ was previously declared here void foo (struct A *a) ^ 2.c:7:6: note: code may be misoptimized unless -fno-strict-aliasing is used Does not produce color output, while: $ gcc *.c -fdiagnostics-color=always -flto does. David is it a known issue?