public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/44515]  New: improve message for missing ";"
@ 2010-06-13 12:44 manu at gcc dot gnu dot org
  2010-06-13 17:26 ` [Bug c/44515] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-06-13 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

Testcase:
void bar(void);
void foo(void)
{
  bar()


}

gcc-4.6:

clang-3.c:7:1: error: expected ‘;’ before ‘}’ token

clang:

t.c:4:8: error: expected ';' after expression
    bar()
         ^
         ;


-- 
           Summary: improve message for missing ";"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: manu at gcc dot gnu dot org


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


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

* [Bug c/44515] improve message for missing ";"
  2010-06-13 12:44 [Bug c/44515] New: improve message for missing ";" manu at gcc dot gnu dot org
@ 2010-06-13 17:26 ` pinskia at gcc dot gnu dot org
  2010-06-13 17:33 ` manu at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-06-13 17:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2010-06-13 17:25 -------
Actually before is more correct than saying after bar().  Because expressions
don't need to end on the same line.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


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


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

* [Bug c/44515] improve message for missing ";"
  2010-06-13 12:44 [Bug c/44515] New: improve message for missing ";" manu at gcc dot gnu dot org
  2010-06-13 17:26 ` [Bug c/44515] " pinskia at gcc dot gnu dot org
@ 2010-06-13 17:33 ` manu at gcc dot gnu dot org
  2010-06-13 18:25 ` joseph at codesourcery dot com
  2010-06-13 19:33 ` manu at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-06-13 17:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from manu at gcc dot gnu dot org  2010-06-13 17:33 -------
(In reply to comment #1)
> Actually before is more correct than saying after bar().  Because expressions
> don't need to end on the same line.

I wonder why people tend to write:

bar();

rather than 

;}

Obviously the second is more correct. ;-)


-- 


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


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

* [Bug c/44515] improve message for missing ";"
  2010-06-13 12:44 [Bug c/44515] New: improve message for missing ";" manu at gcc dot gnu dot org
  2010-06-13 17:26 ` [Bug c/44515] " pinskia at gcc dot gnu dot org
  2010-06-13 17:33 ` manu at gcc dot gnu dot org
@ 2010-06-13 18:25 ` joseph at codesourcery dot com
  2010-06-13 19:33 ` manu at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: joseph at codesourcery dot com @ 2010-06-13 18:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from joseph at codesourcery dot com  2010-06-13 18:25 -------
Subject: Re:  improve message for missing ";"

Perhaps "between expression and '}' token" would be more precise.


-- 


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


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

* [Bug c/44515] improve message for missing ";"
  2010-06-13 12:44 [Bug c/44515] New: improve message for missing ";" manu at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-06-13 18:25 ` joseph at codesourcery dot com
@ 2010-06-13 19:33 ` manu at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-06-13 19:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from manu at gcc dot gnu dot org  2010-06-13 19:33 -------
Perhaps, but the location should be at the end of the expression, where most
programmers would put the ';'. Then, mentioning '}', which may be in a totally
different line with a lot comments in between, would be confusing.


-- 


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


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

end of thread, other threads:[~2010-06-13 19:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-13 12:44 [Bug c/44515] New: improve message for missing ";" manu at gcc dot gnu dot org
2010-06-13 17:26 ` [Bug c/44515] " pinskia at gcc dot gnu dot org
2010-06-13 17:33 ` manu at gcc dot gnu dot org
2010-06-13 18:25 ` joseph at codesourcery dot com
2010-06-13 19:33 ` manu 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).