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 preprocessor/17304] New: Strange "not give a valid preprocessing token" error with macro pasting '##'


GCC 3.4.1 raises a strange preprocessing error with following C file (dummy.c) 
and fails to compile. 
Shown error is "pasting "IDN_struct" and "." does not give a valid 
preprocessing token". 
GCC 2.96 compiles without errors.
The same behaviour has been experienced both on linux and on cygwin.

dummy.c

#define DOUTTpuSet(IDN_chan)  (IDN_chan##.R)
struct s
{
    int R;
} IDN_struct = { 2 } ;

int main(void)
{
return (DOUTTpuSet(IDN_struct));
}

Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.1/specs
Configured with: /gcc/3.4/gcc-3.4.1-1/configure --verbose --prefix=/usr --exec-
prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --
mandir=/usr/share/man --infodir=/usr/share/info --enable-
languages=c,ada,c++,f77,java,objc --enable-nls --without-included-gettext --
enable-libgcj --with-system-zlib --enable-interpreter --enable-threads=posix --
enable-java-gc=boehm --enable-sjlj-exceptions --disable-version-specific-
runtime-libs --disable-win32-registry
Thread model: posix
gcc version 3.4.1 (cygming special)
 /usr/lib/gcc/i686-pc-cygwin/3.4.1/cc1.exe -quiet -v -D__CYGWIN32__ -
D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-
cygwin/3.4.1/../../../../include/w32api -idirafter /usr/lib/gcc/i686-pc-
cygwin/3.4.1/../../../../i686-pc-cygwin/lib/../../include/w32api dummy.c -
quiet -dumpbase dummy.c -mtune=pentiumpro -auxbase dummy -version -
o /cygdrive/c/TEMP/cc0yqmru.s
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-
cygwin/3.4.1/../../../../i686-pc-cygwin/include"
ignoring duplicate directory "/usr/lib/gcc/i686-pc-
cygwin/3.4.1/../../../../i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/i686-pc-cygwin/3.4.1/include
 /usr/include
 /usr/lib/gcc/i686-pc-cygwin/3.4.1/../../../../include/w32api
End of search list.
GNU C version 3.4.1 (cygming special) (i686-pc-cygwin)
	compiled by GNU C version 3.4.1 (cygming special).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=65334
dummy.c:10:1: pasting "IDN_struct" and "." does not give a valid preprocessing 
token

-- 
           Summary: Strange "not give a valid preprocessing token" error
                    with macro pasting '##'
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: enrico dot baraldi at magnetimarelli dot com
                CC: enrico dot baraldi at magnetimarelli dot com,gcc-bugs at
                    gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17304


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