This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/36150] colorize output of gcc
- From: "esigra at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2008 21:55:54 -0000
- Subject: [Bug other/36150] colorize output of gcc
- References: <bug-36150-14488@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from esigra at gmail dot com 2008-05-06 21:55 -------
(In reply to comment #7)
> If you added escape sequences to the string constants in the gcc source
> then it would only work for the C locale messages.
Adding escape sequences for colours would work as well with localization as any
other formatting. Simple example:
printf("%s%s%s%s", warning_format_start, _("warning: "), _("the actual
message"), warning_format_end);
Here warning_format_start may be a pointer to "<orange>" and warning_format_end
a pointer to "</orange>". If colours are disabled, they both point to "". So
the result might be "warning: the actual message" or "<orange>warning: the
actual message</orange>". Localization would work fine for both "warning: " and
"the actual message". I do not really see the problem that you were thinking
of.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36150