You are not logged in.

#1 2013-09-03 12:57:50

gmueckl
Member
Registered: 2013-09-03
Posts: 5

Disable overly verbose GCC output

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

#2 2013-09-03 13:04:54

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,673
Website

Re: Disable overly verbose GCC output

That is gcc-4.8's output.   Not sure it can be silenced.

Offline

#3 2013-09-03 13:11:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,546
Website

Re: Disable overly verbose GCC output

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

#4 2013-09-03 18:50:14

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Re: Disable overly verbose GCC output

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

#5 2013-09-04 08:52:57

gmueckl
Member
Registered: 2013-09-03
Posts: 5

Re: Disable overly verbose GCC output

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

#6 2013-09-04 09:06:47

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,673
Website

Re: Disable overly verbose GCC output

gmueckl wrote:

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

#7 2013-09-04 10:15:50

gmueckl
Member
Registered: 2013-09-03
Posts: 5

Re: Disable overly verbose GCC output

Why are you suggesting a downgrade instead of rebuilding GCC 4.8?

Offline

#8 2013-09-04 10:37:37

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,673
Website

Re: Disable overly verbose GCC output

Because that is the output of gcc-4.8.   We do not configure it in.   That IS the output.

Offline

#9 2013-09-04 16:29:31

gmueckl
Member
Registered: 2013-09-03
Posts: 5

Re: Disable overly verbose GCC output

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

#10 2013-09-04 17:01:44

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: Disable overly verbose GCC output

gmueckl wrote:

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

#11 2013-09-05 10:04:15

gmueckl
Member
Registered: 2013-09-03
Posts: 5

Re: Disable overly verbose GCC output

Allright. I guess this is settled then. Thanks for your input, everyone!

Offline

Board footer

Powered by FluxBB