public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "felix.abecassis at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/59367] New: Syntax error with #pragma message before "else"
Date: Mon, 02 Dec 2013 14:55:00 -0000	[thread overview]
Message-ID: <bug-59367-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 59367
           Summary: Syntax error with #pragma message before "else"
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: felix.abecassis at gmail dot com

Using #pragma message before "else" triggers a syntax error:
pragma_message.c: In function 'main':
pragma_message.c:4:9: note: #pragma message: foo
 #pragma message "foo"
         ^
pragma_message.c:5:5: error: 'else' without a previous 'if'
     else {}
     ^
See attached file for source.

Preprocessed .i file:
# 1 "pragma_message.c"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 30 "/usr/include/stdc-predef.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/predefs.h" 1 3 4
# 31 "/usr/include/stdc-predef.h" 2 3 4
# 1 "<command-line>" 2
# 1 "pragma_message.c"
int main()
{
    if (1) {}

# 4 "pragma_message.c"
#pragma message "foo"
# 4 "pragma_message.c"

    else {}
}


             reply	other threads:[~2013-12-02 14:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02 14:55 felix.abecassis at gmail dot com [this message]
2013-12-02 14:56 ` [Bug c/59367] " felix.abecassis at gmail dot com
2013-12-03 14:45 ` mpolacek at gcc dot gnu.org
2013-12-03 17:56 ` pinskia at gcc dot gnu.org
2013-12-03 18:31 ` schwab@linux-m68k.org
2014-06-12 13:53 ` rguenth at gcc dot gnu.org

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=bug-59367-4@http.gcc.gnu.org/bugzilla/ \
    --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: 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).