public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/34692] [4.2/4.3 regression] Internal error with pragma in macro Date: Wed, 09 Jan 2008 21:23:00 -0000 [thread overview] Message-ID: <20080109194437.8956.qmail@sourceware.org> (raw) In-Reply-To: <bug-34692-1771@http.gcc.gnu.org/bugzilla/> ------- Comment #3 from jakub at gcc dot gnu dot org 2008-01-09 19:44 ------- ISO C99, 6.3.10, paragraph 11 contains: "If there are sequences of preprocessing tokens within the list of arguments that would otherwise act as preprocessing directives, the behavior is undefined." GCC 3.2.x had: if (token->type == CPP_HASH) { cpp_error (pfile, "directives may not be used inside a macro argument"); step_back = true; } then http://gcc.gnu.org/ml/gcc-patches/2002-02/msg01905.html changed that. I'd say doing what 4.1 did is sane, say for: #define FOO(y, x) y #x FOO(const char *p =, a #pragma GCC visibility push(hidden) b cde f g h ); int v = 6; #pragma GCC visibility pop gcc -E would output: # 1 "/tmp/V.c" # 1 "<built-in>" # 1 "<command line>" # 1 "/tmp/V.c" #pragma GCC visibility push(hidden) const char *p = "a b cde f g h"; int v = 6; #pragma GCC visibility pop and gcc -S would: .file "V.c" .hidden p .globl p .section .rodata.str1.1,"aMS",@progbits,1 .LC0: .string "a b cde f g h" .data .align 8 .type p, @object .size p, 8 p: .quad .LC0 .hidden v .globl v .align 4 .type v, @object .size v, 4 v: .long 6 .ident "GCC: (GNU) 4.1.3 20070822 (prerelease)" .section .note.GNU-stack,"",@progbits -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34692
next prev parent reply other threads:[~2008-01-09 19:45 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-01-06 21:47 [Bug preprocessor/34692] New: [4.2/4.3 regression] reichelt at gcc dot gnu dot org 2008-01-06 21:48 ` [Bug preprocessor/34692] [4.2/4.3 regression] Internal error with prgama in macro reichelt at gcc dot gnu dot org 2008-01-06 22:31 ` [Bug preprocessor/34692] [4.2/4.3 regression] Internal error with pragma " pinskia at gcc dot gnu dot org 2008-01-07 21:19 ` tromey at gcc dot gnu dot org 2008-01-09 21:23 ` jakub at gcc dot gnu dot org [this message] 2008-01-11 8:52 ` jakub at gcc dot gnu dot org 2008-01-23 16:36 ` jakub at gcc dot gnu dot org 2008-01-25 9:44 ` jakub at gcc dot gnu dot org 2008-01-25 9:47 ` [Bug preprocessor/34692] [4.2 " jakub at gcc dot gnu dot org 2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org 2008-05-19 20:32 ` jsm28 at gcc dot gnu dot org 2009-03-31 14:58 ` jsm28 at gcc dot gnu dot 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=20080109194437.8956.qmail@sourceware.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).