This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/16275] New: error in C string catenation


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]