GNOME Bugzilla – Bug 710963
Add -fdiagnostics-color support to GNOME_COMPILE_WARNINGS
Last modified: 2013-12-22 11:21:04 UTC
Patch coming to add -fdiagnostics-color to the GNOME_COMPILE_WARNINGS macro, as per http://tecnocode.co.uk/2013/10/25/colourful-gcc-output/.
Created attachment 258213 [details] [review] compiler-flags: Replace deprecated AC_HELP_STRING with AS_HELP_STRING
Created attachment 258214 [details] [review] compiler-flags: Simplify a case statement slightly
Created attachment 258215 [details] [review] compiler-flags: Add -fdiagnostics-color=auto to GNOME_COMPILE_WARNINGS As it doesn’t affect the type of warnings or errors reported by the compiler, it is unconditionally enabled (subject to compiler support) for all user-supplied values of the --enable-compile-warnings flag.
Comment on attachment 258213 [details] [review] compiler-flags: Replace deprecated AC_HELP_STRING with AS_HELP_STRING OK, please push.
Comment on attachment 258214 [details] [review] compiler-flags: Simplify a case statement slightly Looks fine, please push.
Comment on attachment 258215 [details] [review] compiler-flags: Add -fdiagnostics-color=auto to GNOME_COMPILE_WARNINGS Thanks for the patch. Sorry to say it, but I do not think that GNOME_COMPILE_WARNINGS is the place for cosmetic additions. I have been subjected to the colourful warnings on Fedora 20 and find them garish at best. There is at least one other gnome-common bugs about cosmetic changes, such as enabling Automake silent rules in bug 580062, so it might make sense to have a macro for applying some nice style options, but I think it would have to be opt-in, and distinct from compiler warnings.
Comment on attachment 258213 [details] [review] compiler-flags: Replace deprecated AC_HELP_STRING with AS_HELP_STRING commit 62f7546a039296e42b90ca9f9590caf9db5bc6ef Author: Philip Withnall <philip@tecnocode.co.uk> Date: Sun Oct 27 12:08:38 2013 +0000 compiler-flags: Simplify a case statement slightly macros2/gnome-compiler-flags.m4 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit eb0a7dce6b639e354b4b9736ed879921595f12fb Author: Philip Withnall <philip@tecnocode.co.uk> Date: Sun Oct 27 12:02:55 2013 +0000 compiler-flags: Replace deprecated AC_HELP_STRING with AS_HELP_STRING macros2/gnome-compiler-flags.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
(In reply to comment #6) > (From update of attachment 258215 [details] [review]) > Thanks for the patch. Sorry to say it, but I do not think that > GNOME_COMPILE_WARNINGS is the place for cosmetic additions. I have been > subjected to the colourful warnings on Fedora 20 and find them garish at best. > There is at least one other gnome-common bugs about cosmetic changes, such as > enabling Automake silent rules in bug 580062, so it might make sense to have a > macro for applying some nice style options, but I think it would have to be > opt-in, and distinct from compiler warnings. I put it in GNOME_COMPILE_WARNINGS because it’s a flag which only affects (the reporting of) compile warnings. I see your point, though. How about expanding GNOME_COMPILE_WARNINGS to have a --enable-compiler-colors option (or something like that; better name suggestions welcome)? I’m reluctant to add a whole new macro because that greatly increases the barrier for adoption: instead of adding --enable-compiler-colors to autogenargs in their .jhbuildrc, everyone would now also have to add a macro invocation in all their modules, and if, for example, I wanted to use compiler colours on a module I had no commit rights to, I couldn’t (without manually setting -fdiagnostics-color=auto, which sort of goes against the point of this). In fact, if people are going to have to opt-in to this, why don’t we not put it in gnome-common at all, and just recommend that people opt-in by adding -fdiagnostics-color=auto to their CFLAGS in .jhbuildrc?
Thoughts?
Sorry for the delay. I think this is best off outside of gnome-common. It is quite easy to add this on a per-user basis, as you described, so I do not think that there is much to gain by adding another argument to GNOME_COMPILE_WARNINGS for something that is cosmetic. That seems to be something which the user should set as desired. Adding the flag to the sample jhbuildrc might be a good place.
(In reply to comment #10) > Adding the flag to the sample jhbuildrc might be a good > place. https://bugzilla.gnome.org/show_bug.cgi?id=720925 Thanks for the feedback. :-)