public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/17854] New: Accept statement expressions at top level Date: Tue, 05 Oct 2004 22:55:00 -0000 [thread overview] Message-ID: <20041005225551.17854.rth@gcc.gnu.org> (raw) The primary motivation for allowing this is to handle macros provided by system headers. For instance, the htonl macro from <netinet/in.h> in glibc uses statement expressions, but from the user's point of view it looks like a function call. Admittedly gcc 3.4 gives a much better error message than did previous versions, but it can still be confusing. It does seem like it'd be perfectly straightforward to implement -- just drop the expression into the global constructor function and be done, but as the attached test case shows, it's not quite that simple due to the parsing of "register" outside the syntactic scope of a function. -- Summary: Accept statement expressions at top level Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rth at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17854
next reply other threads:[~2004-10-05 22:55 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-10-05 22:55 rth at gcc dot gnu dot org [this message] 2004-10-05 22:56 ` [Bug c++/17854] " rth at gcc dot gnu dot org 2004-10-05 22:58 ` pinskia at gcc dot gnu dot org 2004-10-05 23:05 ` pinskia at gcc dot gnu dot org 2004-10-06 0:09 ` rth at gcc dot gnu dot org 2004-10-06 0:47 ` gdr at cs dot tamu dot edu 2004-10-06 0:56 ` rth at gcc dot gnu dot org 2004-10-06 1:03 ` Gabriel Dos Reis 2004-10-06 1:03 ` gdr at cs dot tamu dot edu
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=20041005225551.17854.rth@gcc.gnu.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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: linkBe 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).