You are not logged in.
Hi!
I just wrote this in a nicer form but was thrown out by the forum software before I was able to submit. So a short form has to do now.
How do I disable the overly verbose GCC error/warning message output that seems to be default in Arch? The two lines that are wasted for sourcecode and location markers are useless. Also, I can't change every set of compiler options in every build system I have to use for the software I'm working on. So I need some sort of global solution to this problem. Any ideas?
Gregor
Offline
That is gcc-4.8's output. Not sure it can be silenced.
Offline
Couldn't makefiles help with both of these?
You can redirect stderr to stdout, then filter with any other tool - a simple example might be:
gcc infile.c 2>&1 | grep -v "^ ""UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
If a gcc warning says "enabled by default" after it, they have intentionally made it so that no flag will suppress it. If not, you can disable the warning with e.g. "-Wno-return-type".
6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.
Offline
OK, thanks for the replies, but they are not helping me.
My issue is not about which warnings and errors get shown. It is with the 3 line format that I only encounter on Arch. The first one contains the message, the second is wasted by citing the line of source code mentioned and the third one is a total waste of space because it is only used to place a marker below the source code where GCC thinks it should direct my attention. The last two lines is what I want to get rid of - forever.
Doing something like grep won't help me, either. I would have to fiddle with about a dozend different source trees with completely different build systems (Makefiles, scons, cmake...), so this is unfortunately completely impractical.
How are GCC's default settings controlled anyway? There is no one set of defaults for each version of GCC. They do vary across distributions. But how does this happen?
Offline
My issue is not about which warnings and errors get shown. It is with the 3 line format that I only encounter on Arch. The first one contains the message, the second is wasted by citing the line of source code mentioned and the third one is a total waste of space because it is only used to place a marker below the source code where GCC thinks it should direct my attention. The last two lines is what I want to get rid of - forever.
Then uninstall gcc-4.8 and build yourself a package for gcc-4.7... You only see it on Arch because few other distros have gcc-4.8 yet.
Offline
Why are you suggesting a downgrade instead of rebuilding GCC 4.8?
Offline
Because that is the output of gcc-4.8. We do not configure it in. That IS the output.
Offline
OK, thanks. IMO that's just a bad default. No offense meant - I know that you didn't make that decision.
What I want is -fno-diagnostics-show-caret without having to specify it everywhere. So you're saying that I'd have to patch that into gcc 4.8 somehow?
Offline
OK, thanks. IMO that's just a bad default. No offense meant - I know that you didn't make that decision.
What I want is -fno-diagnostics-show-caret without having to specify it everywhere. So you're saying that I'd have to patch that into gcc 4.8 somehow?
You can patch gcc or if you use proper makefiles, you can add it to {C,CXX,CPP}FLAGS. For makepkg, this is configured in makepkg.conf. If you use gcc directly, create a shell alias
Last edited by progandy (2013-09-04 17:02:19)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
Allright. I guess this is settled then. Thanks for your input, everyone!
Offline