Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 33952
Product:  
Component:  
Status: RESOLVED
Resolution: WONTFIX
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Eelis <gcc-bugzilla@contacts.eelis.net>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 33952 depends on: Show dependency tree
Show dependency graph
Bug 33952 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2007-10-30 22:15
Consider:

  int main () { goto foo; { int i = 0; foo:; } }

Compiling this snippet /without/ -Wfatal-errors produces:

  t.cpp: In function ‘int main()’:
  t.cpp:1: error: jump to label ‘foo’
  t.cpp:1: error:   from here
  t.cpp:1: error:   crosses initialization of ‘int i’

Compiling the snippet /with/ -Wfatal-errors, we get:

  t.cpp: In function ‘int main()’:
  t.cpp:1: error: jump to label ‘foo’
  compilation terminated due to -Wfatal-errors.

Alas, half the error message has disappeared.

------- Comment #1 From Andrew Pinski 2007-10-30 22:21 -------
Well the second error: really should be notes.  But really this is doing what
-Wfatal-errors is designed to do.  -Wfatal-errors is really was only designed
to help out reducing testcases and nothing else.

------- Comment #2 From Eelis 2007-10-31 00:44 -------
Then perhaps I ought to explain what I'm using -Wfatal-errors for.

I wrote an IRC bot called geordi ( http://www.eelis.net/geordi ) that accepts
lines of C++ code, compiles them with g++, and either reports the first
compilation error or proceeds to run the resulting program and report its
output. Geordi has proved to be an extremely useful demonstration tool that is
now used in several C++ channels, including Freenode's ##c++ and ##iso-c++.

Since geordi only reports the first error (if any), it passes -Wfatal-errors to
g++ to not waste time compiling further (response time is very important here).
Unfortunately, this means that it currently reports truncated errors for
snippets like the one I mentioned.

------- Comment #3 From Richard Guenther 2007-10-31 09:20 -------
Apart from the issue regarding that the last two errors should be notes this
is really impossible to "fix" if -Wfatal-errors should continue to work as
designed.  That is, the only way would be to annotate all _callers_ of
diagnostic
functions to eventually terminate compilation, which is a too large overhead
really.

Sorry.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug