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