Bug 37773 - -Wfatal-errors aborts too early
Summary: -Wfatal-errors aborts too early
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 47429 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-08 16:17 UTC by Carlo Wood
Modified: 2011-01-25 10:08 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlo Wood 2008-10-08 16:17:21 UTC
Many errors span multiple lines. However, any of the first lines start with 'error:' (or so it seems) the rest is not printed anymore (with using -Wfatal-errors).

For example:

hikaru:~/projects/cwchessboard/cwchessboard-objdir>make tstpgn
source='PgnDatabase.cc' object='tstpgn-PgnDatabase.o' libtool=no \
	DEPDIR=.deps depmode=pch /bin/sh ../cwchessboard/depcomp \
	g++ -DHAVE_CONFIG_H -I. -I../cwchessboard    -DCWDEBUG -I/usr/local/install/4.3.1/include   $(pkg-config --cflags giomm-2.4) -g3 -Winline -Wfatal-errors -DDEBUG -c -o tstpgn-PgnDatabase.o `test -f 'PgnDatabase.cc' || echo '../cwchessboard/'`PgnDatabase.cc
../cwchessboard/MemoryBlockList.h: In member function ‘void cwchess::pgn::DatabaseSeekable::read_async_open_ready(Glib::RefPtr<Gio::AsyncResult>&)’:
../cwchessboard/MemoryBlockList.h:124: error: ‘char* util::MemoryBlockNode::block_begin()’ is private
compilation terminated due to -Wfatal-errors.
make: *** [tstpgn-PgnDatabase.o] Error 1


This is little useful. Now I have to recompile without -Wfatal-errors to find:

../cwchessboard/PgnDatabase.cc:52: error: within this context
Comment 1 Carlo Wood 2008-10-08 16:48:47 UTC
Here's another one:

../cwchessboard/PgnDatabase.cc:65: error: no matching function for call to ‘util::MemoryBlockList::append(gssize&)’
../cwchessboard/MemoryBlockList.h:232: note: candidates are: void util::MemoryBlockList::append(Glib::RefPtr<util::MemoryBlockNode>&, size_t)

With -Wfatal-errors the second line is not printed.
Comment 2 pinskia@gmail.com 2008-10-08 16:57:04 UTC
Subject: Re:  -Wfatal-errors aborts too early



Sent from my iPhone

On Oct 8, 2008, at 9:48 AM, "carlo at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

>
>
> ------- Comment #1 from carlo at gcc dot gnu dot org  2008-10-08  
> 16:48 -------
> Here's another one:

This expected behaviour of this option. It was not designed for users  
really to use it. It was designed to make it easier and faster for  
automatic reduction of ICEs.

Thanks,
Andrew Pinski

>
>
> ../cwchessboard/PgnDatabase.cc:65: error: no matching function for  
> call to
> ‘util::MemoryBlockList::append(gssize&)’
> ../cwchessboard/MemoryBlockList.h:232: note: candidates are: void
> util::MemoryBlockList::append(Glib::RefPtr<util::MemoryBlockNode>&,  
> size_t)
>
> With -Wfatal-errors the second line is not printed.
>
>
> -- 
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37773
>
Comment 3 Richard Biener 2008-10-08 20:00:53 UTC
Works as desigened.  Really ;)
Comment 4 Andrew Pinski 2011-01-24 23:02:44 UTC
*** Bug 47429 has been marked as a duplicate of this bug. ***
Comment 5 Manuel López-Ibáñez 2011-01-25 09:57:03 UTC
(In reply to comment #3)
> Works as desigened.  Really ;)

So what is the point of -fmax-errors=N ? 

Shouldn't the documentation of Wfatal-errors say: "This option is not for users but for compiler developers only"?

BTW, clang also supports -Wfatal-errors=option.
Comment 6 Jonathan Wakely 2011-01-25 10:08:42 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > Works as desigened.  Really ;)
> 
> So what is the point of -fmax-errors=N ? 

Eh? Surely -fmax-errors *is* the option intended to be useful to users who want to limit the error output.

Just because -Wfatal-errors is designed for something different, doesn't mean -fmax-errors has no point.