public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/59367] New: Syntax error with #pragma message before "else"
@ 2013-12-02 14:55 felix.abecassis at gmail dot com
  2013-12-02 14:56 ` [Bug c/59367] " felix.abecassis at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: felix.abecassis at gmail dot com @ 2013-12-02 14:55 UTC (permalink / raw)
  To: gcc-bugs

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 {}
}


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

end of thread, other threads:[~2014-06-12 13:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-02 14:55 [Bug c/59367] New: Syntax error with #pragma message before "else" felix.abecassis at gmail dot com
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

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