This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
include preprocess bug?
- From: "S.B.M. Post" <sbmpost at science dot uva dot nl>
- To: bug-gcc at gnu dot org
- Date: Thu, 20 Mar 2003 20:27:05 +0100 (CET)
- Subject: include preprocess bug?
HI! I've noticed a difference between gcc 2.95.4 and gcc >= 2.96. I'm not
sure if it is a bug so therefore i use the mail system. When i compile the
following code, i get different results. (Test0.h indeed does not exist)
(mailto:sbmpost at science dot uva dot nl)
bug.cpp
-------------
#include <stdio.h>
#define NR "0"
#include "Test" NR ".h"
gcc 2.95.4
-------------
bug.cpp:3: Test0.h: No Such file or directory
gcc >= 2.96
-------------
bug.cpp:3:17: warning: extra tokens at end of #include directive
bug.cpp:3:24: Test: No such file or directory
`workaround'
-------------
#include <stdio.h>
#define xconcat(arg1,arg2) concat(arg1,arg2)
#define concat(arg1,arg2) arg1 ## arg2.h
#define xstr(s) str(s)
#define str(s) #s
#define NR 0
#include xstr(xconcat(Test,NR))