public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33952]  New: -Wfatal-errors truncates multi-line error messages.
@ 2007-10-30 22:16 gcc-bugzilla at contacts dot eelis dot net
  2007-10-30 22:21 ` [Bug c++/33952] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gcc-bugzilla at contacts dot eelis dot net @ 2007-10-30 22:16 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 954 bytes --]

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.


-- 
           Summary: -Wfatal-errors truncates multi-line error messages.
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc-bugzilla at contacts dot eelis dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33952


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/33952] -Wfatal-errors truncates multi-line error messages.
  2007-10-30 22:16 [Bug c++/33952] New: -Wfatal-errors truncates multi-line error messages gcc-bugzilla at contacts dot eelis dot net
@ 2007-10-30 22:21 ` pinskia at gcc dot gnu dot org
  2007-10-31  0:45 ` gcc-bugzilla at contacts dot eelis dot net
  2007-10-31  9:20 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-30 22:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  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.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33952


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/33952] -Wfatal-errors truncates multi-line error messages.
  2007-10-30 22:16 [Bug c++/33952] New: -Wfatal-errors truncates multi-line error messages gcc-bugzilla at contacts dot eelis dot net
  2007-10-30 22:21 ` [Bug c++/33952] " pinskia at gcc dot gnu dot org
@ 2007-10-31  0:45 ` gcc-bugzilla at contacts dot eelis dot net
  2007-10-31  9:20 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: gcc-bugzilla at contacts dot eelis dot net @ 2007-10-31  0:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from gcc-bugzilla at contacts dot eelis dot net  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.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33952


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/33952] -Wfatal-errors truncates multi-line error messages.
  2007-10-30 22:16 [Bug c++/33952] New: -Wfatal-errors truncates multi-line error messages gcc-bugzilla at contacts dot eelis dot net
  2007-10-30 22:21 ` [Bug c++/33952] " pinskia at gcc dot gnu dot org
  2007-10-31  0:45 ` gcc-bugzilla at contacts dot eelis dot net
@ 2007-10-31  9:20 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-10-31  9:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  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.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33952


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-10-31  9:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-30 22:16 [Bug c++/33952] New: -Wfatal-errors truncates multi-line error messages gcc-bugzilla at contacts dot eelis dot net
2007-10-30 22:21 ` [Bug c++/33952] " pinskia at gcc dot gnu dot org
2007-10-31  0:45 ` gcc-bugzilla at contacts dot eelis dot net
2007-10-31  9:20 ` rguenth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).