public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: preprocessor/2883: cpp stringizing problem 1
@ 2001-05-20 13:56 Carlo Wood
0 siblings, 0 replies; 3+ messages in thread
From: Carlo Wood @ 2001-05-20 13:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR preprocessor/2883; it has been noted by GNATS.
From: Carlo Wood <carlo@alinoe.com>
To: "Markus F.X.J. Oberhumer" <markus@oberhumer.com>
Cc: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org
Subject: Re: preprocessor/2883: cpp stringizing problem 1
Date: Sun, 20 May 2001 22:51:22 +0200
On Sun, May 20, 2001 at 08:44:32PM +0200, Markus F.X.J. Oberhumer wrote:
> $ gcc-3.0 -c -Werror bug02.c
> bug02.c:13:23: pasting ""_"" and ""foo"" does not give a valid preprocessing
> token
...
> #define ASM_NAME(x) __asm__("_" ## #x)
A string literal can't form a new preprocessing token by catenation with another.
This warning is correct. Instead you should write:
#define ASM_NAME(x) __asm__("_" #x)
--
Carlo Wood <carlo@alinoe.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: preprocessor/2883: cpp stringizing problem 1
@ 2001-05-20 11:56 Zack Weinberg
0 siblings, 0 replies; 3+ messages in thread
From: Zack Weinberg @ 2001-05-20 11:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR preprocessor/2883; it has been noted by GNATS.
From: "Zack Weinberg" <zackw@stanford.edu>
To: "Markus F.X.J. Oberhumer" <markus@oberhumer.com>
Cc: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org
Subject: Re: preprocessor/2883: cpp stringizing problem 1
Date: Sun, 20 May 2001 11:55:18 -0700
On Sun, May 20, 2001 at 08:44:32PM +0200, Markus F.X.J. Oberhumer wrote:
> $ gcc-3.0 -c -Werror bug02.c
> bug02.c:13:23: pasting ""_"" and ""foo"" does not give a valid preprocessing
> token
...
> #define ASM_NAME(x) __asm__("_" ## #x)
This is not valid C. As it says, pasting together the string
constants "_" and "foo" does not produce a valid single token.
You can just remove the ## from your code. "_" "foo" is understood as
meaning the same thing as "_foo" by all versions of GCC.
--
zw Breeding replacement security officers on farms where giant robot
combine harvesters operate would tend to increase the evolutionary
selection pressure, which may be the desired effect.
-- David G. Bell
^ permalink raw reply [flat|nested] 3+ messages in thread
* preprocessor/2883: cpp stringizing problem 1
@ 2001-05-20 11:46 Markus F.X.J. Oberhumer
0 siblings, 0 replies; 3+ messages in thread
From: Markus F.X.J. Oberhumer @ 2001-05-20 11:46 UTC (permalink / raw)
To: gcc-gnats; +Cc: debian-gcc
>Number: 2883
>Category: preprocessor
>Synopsis: cpp 3.0 200010426 stringizing problem 1
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Sun May 20 11:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Markus F.X.J. Oberhumer <markus@oberhumer.com>
>Release: 3.0 20010426 (Debian prerelease) (Debian testing/unstable)
>Organization:
none
>Environment:
System: Linux laetitia 2.4.3 #1 Wed Apr 4 03:58:32 CEST 2001 i586 unknown
Architecture: i586
=20
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v
--enable-languages=3Dc,c++,java,f77,proto,objc --prefix=3D/usr
--infodir=3D/share/info --mandir=3D
/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib
--enable-long-long --enable-nls --without-x --without
-included-gettext --disable-checking --enable-threads=3Dposix
--enable-java-gc=3Dboehm --with-cpp-install-dir=3Dbin --enable-objc-gc=20
i386-linux
>Description:
cpp 3.0 200010426 stringizing problem 1
>How-To-Repeat:
$ gcc-3.0 -c -Werror bug02.c
bug02.c:13:23: pasting ""_"" and ""foo"" does not give a valid preprocessin=
g
token
----------------------------------------
$ cat bug02.c
/* Markus F.X.J. Oberhumer <markus@oberhumer.com>
* gcc 3.0 20010426 (Debian prerelease) bug report:
*
* cpp stringizing problem
*/
#if defined(__GNUC__)
#define ASM_NAME(x) __asm__("_" ## #x)
#else
#define ASM_NAME(x)
#endif
extern void foo(void) ASM_NAME(foo);
int dummy =3D 0; /* avoid empty source file */
>Fix:
=20
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-05-20 13:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-20 13:56 preprocessor/2883: cpp stringizing problem 1 Carlo Wood
-- strict thread matches above, loose matches on Subject: below --
2001-05-20 11:56 Zack Weinberg
2001-05-20 11:46 Markus F.X.J. Oberhumer
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).