This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16275] New: error in C string catenation
- From: "planta at planta dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jun 2004 15:41:21 -0000
- Subject: [Bug c/16275] New: error in C string catenation
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Seems like GCC 3.3.3 has problems with catenating strings by defining C macros
in this way. Worked at least with GCC 2.9.5.
#define PP_CAT(s1,s2) s1 ## s2
char *templ = PP_CAT(DBUTILNAME, "XXXXXX");
GCC ends up in:
pdbutil.c:699:50: pasting "DBUTILNAME" and ""XXXXXX"" does not give a valid
preprocessing token
GCC output:
Reading specs from /opt/sfw/gcc-3/lib/gcc-lib/sparc-sun-solaris2.9/3.3/specs
Konfiguriert mit: ../gcc-3.3/configure --prefix=/opt/sfw/gcc-3 --with-
ld=/usr/ccs/bin/ld --with-as=/usr/ccs/bin/as --without-gnu-ld --without-gn
u-as --enable-shared
Thread model: posix
gcc-Version 3.3
/opt/sfw/gcc-3/lib/gcc-lib/sparc-sun-solaris2.9/3.3/cc1 -E -quiet -v -
I../libclnt -I../libgen -I../libutil -I../libphelp -D__GNUC__=3 -D__GNUC_
MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -Dsparc -D__sparc__ -D__sparc -
D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc -DUNIX -DSUNOS -DDYNAMIC_DBDO
-DPDB_SINGLE_ATTACH -D_GNU_SOURCE -DHAVE_PREADWRITE -
DDEBUG ../libutil/pdbutil.c -m32 -Wall pdbutil.i
nicht vorhandenes Verzeichnis »/usr/local/include« wird ignoriert
nicht vorhandenes Verzeichnis »/opt/sfw/gcc-3/sparc-sun-solaris2.9/include«
wird ignoriert
#include "..." search starts here:
#include <...> search starts here:
../libclnt
../libgen
../libutil
../libphelp
/opt/sfw/gcc-3/include
/opt/sfw/gcc-3/lib/gcc-lib/sparc-sun-solaris2.9/3.3/include
/usr/include
End of search list.
../libutil/pdbutil.c:699:50: pasting "DBUTILNAME" and ""XXXXXX"" does not give
a valid preprocessing token
--
Summary: error in C string catenation
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P1
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: planta at planta dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: solaris59
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16275