public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* preprocessor/8900: Warning for code on same line as #endif needs -pedantic
@ 2002-12-11  7:46 mpitt
  0 siblings, 0 replies; 2+ messages in thread
From: mpitt @ 2002-12-11  7:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8900
>Category:       preprocessor
>Synopsis:       Warning for code on same line as #endif needs -pedantic
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 11 07:46:02 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Mike Pitt <mpitt@software.plasmon.com>
>Release:        2.95.2 and 2.95.4
>Organization:
>Environment:
FreeBSD and Debian GNU/Linux
(FreeBSD: gcc version 2.95.2 19991024 (release))
(Linux: gcc version 2.95.4 20011002 (Debian prerelease))
>Description:
A mistake by a developer led to some code being on the same line as an #endif conditional.

gcc rightly ignored this line of code, but despite our warning levels did not shout at us. This was a problem as the code being ignored released a lock. When we found the problem we investigated what level would be needed to get a warning and found...

leo:~/deleteme:22$ gcc -Wall yabt.c -o yabt
leo:~/deleteme:23$ gcc  -Wall -ansi yabt.c -o yabt
leo:~/deleteme:24$ gcc  -Wall -ansi -pedantic yabt.c -o yabt
yabt.c:9: warning: text following `#endif' violates ANSI standard
yabt.c:13: warning: text following `#endif' violates ANSI standard

It seems there is no warning level lower than pedantic to show this, it would be nice if there were.

Attached sample (erroneous) C code to demonstrate problem.

The code that had the bug in has ...
-Wall -Wno-unused -Wno-switch Wpointer-arith -Wredundant-decls -Wnested-externs -Winline -W -Werror
turned on.
>How-To-Repeat:
Compile yabt.c with various warnings. 

Only get warned of ignored code with -pedantic
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: preprocessor/8900: Warning for code on same line as #endif needs -pedantic
@ 2002-12-11  9:53 neil
  0 siblings, 0 replies; 2+ messages in thread
From: neil @ 2002-12-11  9:53 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mpitt, nobody

Synopsis: Warning for code on same line as #endif needs -pedantic

State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Wed Dec 11 09:53:23 2002
State-Changed-Why:
    Upgrade to 3.x.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8900


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

end of thread, other threads:[~2002-12-11 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-11  7:46 preprocessor/8900: Warning for code on same line as #endif needs -pedantic mpitt
2002-12-11  9:53 neil

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).