public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47332] New: g++ compiler should check for empty while or for bodies
@ 2011-01-17 17:48 howarth at nitro dot med.uc.edu
2011-01-17 17:49 ` [Bug c++/47332] " howarth at nitro dot med.uc.edu
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2011-01-17 17:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47332
Summary: g++ compiler should check for empty while or for
bodies
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: howarth@nitro.med.uc.edu
The current Apple FSF g++-4.2 compiler has a check_empty_body() routine in
gcc/cp/parser.c which provides warnings of empty bodies in for and while
statements of the form...
"suggest a space before %<;%> or explicit braces around empty body in %<%s%>
statement"
This check in the Apple g++-4.2 allowed the erroneous ";" in the for statement
in dump_eh_tree(), to be detected (PR47319). This error would have been almost
impossible to detect without the check_empty_body() routine present in Apple's
g++-4.2 and would be a useful addition to FSF gcc.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/47332] g++ compiler should check for empty while or for bodies
2011-01-17 17:48 [Bug c++/47332] New: g++ compiler should check for empty while or for bodies howarth at nitro dot med.uc.edu
@ 2011-01-17 17:49 ` howarth at nitro dot med.uc.edu
2011-01-17 18:13 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2011-01-17 17:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47332
Jack Howarth <howarth at nitro dot med.uc.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/47332] g++ compiler should check for empty while or for bodies
2011-01-17 17:48 [Bug c++/47332] New: g++ compiler should check for empty while or for bodies howarth at nitro dot med.uc.edu
2011-01-17 17:49 ` [Bug c++/47332] " howarth at nitro dot med.uc.edu
@ 2011-01-17 18:13 ` jakub at gcc dot gnu.org
2011-01-17 20:02 ` howarth at nitro dot med.uc.edu
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-17 18:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47332
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |jakub at gcc dot gnu.org
Resolution| |INVALID
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-17 17:54:23 UTC ---
It was removed on purpose, see PR36478 and discussions about it on gcc-patches.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/47332] g++ compiler should check for empty while or for bodies
2011-01-17 17:48 [Bug c++/47332] New: g++ compiler should check for empty while or for bodies howarth at nitro dot med.uc.edu
2011-01-17 17:49 ` [Bug c++/47332] " howarth at nitro dot med.uc.edu
2011-01-17 18:13 ` jakub at gcc dot gnu.org
@ 2011-01-17 20:02 ` howarth at nitro dot med.uc.edu
2011-01-17 20:03 ` howarth at nitro dot med.uc.edu
2011-01-17 20:55 ` jakub at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2011-01-17 20:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47332
--- Comment #2 from Jack Howarth <howarth at nitro dot med.uc.edu> 2011-01-17 19:56:46 UTC ---
(In reply to comment #1)
> It was removed on purpose, see PR36478 and discussions about it on gcc-patches.
So it was removed because of the absence of an appropriate algorithm to
implement it
rather than lack of utility of the feature itself?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/47332] g++ compiler should check for empty while or for bodies
2011-01-17 17:48 [Bug c++/47332] New: g++ compiler should check for empty while or for bodies howarth at nitro dot med.uc.edu
` (2 preceding siblings ...)
2011-01-17 20:02 ` howarth at nitro dot med.uc.edu
@ 2011-01-17 20:03 ` howarth at nitro dot med.uc.edu
2011-01-17 20:55 ` jakub at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2011-01-17 20:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47332
--- Comment #3 from Jack Howarth <howarth at nitro dot med.uc.edu> 2011-01-17 19:58:43 UTC ---
Also, is there a convention in FSF gcc coding for how empty bodies are supposed
to be handled? Should we have the extra space or explicit braces that the old
patch requested for empty bodies?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/47332] g++ compiler should check for empty while or for bodies
2011-01-17 17:48 [Bug c++/47332] New: g++ compiler should check for empty while or for bodies howarth at nitro dot med.uc.edu
` (3 preceding siblings ...)
2011-01-17 20:03 ` howarth at nitro dot med.uc.edu
@ 2011-01-17 20:55 ` jakub at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-17 20:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47332
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-17 20:02:43 UTC ---
No, it was removed because it was very badly designed warning.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-01-17 20:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-17 17:48 [Bug c++/47332] New: g++ compiler should check for empty while or for bodies howarth at nitro dot med.uc.edu
2011-01-17 17:49 ` [Bug c++/47332] " howarth at nitro dot med.uc.edu
2011-01-17 18:13 ` jakub at gcc dot gnu.org
2011-01-17 20:02 ` howarth at nitro dot med.uc.edu
2011-01-17 20:03 ` howarth at nitro dot med.uc.edu
2011-01-17 20:55 ` jakub at gcc dot gnu.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).