public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: liamq@punkass.com
To: gcc-gnats@gcc.gnu.org
Subject: c++/3898: broken "do {...} while ()" causes fatal parse error
Date: Tue, 31 Jul 2001 09:16:00 -0000	[thread overview]
Message-ID: <20010731161128.17177.qmail@sourceware.cygnus.com> (raw)

>Number:         3898
>Category:       c++
>Synopsis:       broken "do {...} while ()" causes fatal parse error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 31 09:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Kyle Schaffrick
>Release:        gcc version 3.0.1 20010626 (prerelease)
>Organization:
>Environment:

>Description:
when a do {...} while (cond); construct is used in a C++ program, if the "while (cond);" is accidentally omitted, an unrecoverable parse error occurs.

the bug causes a Segmentation Fault on RedHat 7.0-bundled version of GCC, but it still exists as a "confused, bailing out" error in the build used by CodeSourcery's online compiler test (used for this bug report). apparently the compiler does not crash anymore, but compilation stops and the obfusicated error messages sometimes make the error difficult to spot.

The compiler output (error messages, warnings, etc):
   src.cpp: In function `int main()':
   src.cpp:10: parse error before `return'
   src.cpp:4: confused by earlier errors, bailing out
>How-To-Repeat:
program: (src.cpp)
int main(void)
{
	int iJunk = 0;
	do {
		iJunk++;
		if (iJunk > 10)
			return 0;
	} // accidental exclusion of "while (cond);"
	  // causes fatal parse error
	return 0;
}

The system type (the dir name after gcc-lib in the output of gcc -v 
   i386-pc-linux-gnu

The complete command line that triggers the bug 
   gcc src.cpp
>Fix:

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


                 reply	other threads:[~2001-07-31  9:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010731161128.17177.qmail@sourceware.cygnus.com \
    --to=liamq@punkass.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).