This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
CPP warning while compiling linux-kernel-2.4, correct?
- To: gcc-bugs at gcc dot gnu dot org
- Subject: CPP warning while compiling linux-kernel-2.4, correct?
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Mon, 13 Nov 2000 22:36:45 +0100
Hi,
this has come up earlier already, but I couldn't find a final answer. If I
preprocess the following testcase with current CVS:
#define KERN_WARNING "<1>"
#define RPCDBG_FILEOP 0x0020
#define RPCDBG_FACILITY RPCDBG_FILEOP
#define dprintk(args...) dfprintk( FACILITY , ## args )
#define ifdebug(fac) if (rpc_debug & RPCDBG_##fac)
#define dfprintk(fac,args...) do { ifdebug( fac ) printk( ## args ); }
while(0)
dfprintk(FILEOP, "nfsd: fh_lock(%s)\n");
dfprintk(FILEOP, "nfsd: fh_lock(%s)\n", SVCFH_fmt(fhp));
dprintk(KERN_WARNING "nfsd: fh_lock(%s)\n");
dprintk(KERN_WARNING "nfsd: fh_lock(%s)\n", SVCFH_fmt(fhp));
I get the following output/warnings:
[fsirl@entropy:~/bugs]$ ~/obj/gccm/gcc/stage1/xgcc -B ~/obj/gccm/gcc/stage1/
-W -Wall -E kernel-cpp-warning.c
# 1 "kernel-cpp-warning.c"
# 9 "kernel-cpp-warning.c"
kernel-cpp-warning.c:9:1: warning: pasting "(" and ""nfsd: fh_lock(%s)\n""
does not give a valid preprocessing token
do { if (rpc_debug & 0x0020) printk("nfsd: fh_lock(%s)\n" ); } while(0);
kernel-cpp-warning.c:10:1: warning: pasting "(" and ""nfsd: fh_lock(%s)\n""
does not give a valid preprocessing token
do { if (rpc_debug & 0x0020) printk("nfsd: fh_lock(%s)\n", SVCFH_fmt(fhp) );
} while(0);
kernel-cpp-warning.c:12:1: warning: pasting "(" and "KERN_WARNING" does not
give a valid preprocessing token
do { if (rpc_debug & 0x0020) printk(KERN_WARNING "nfsd: fh_lock(%s)\n" ); }
while(0);
kernel-cpp-warning.c:13:1: warning: pasting "(" and "KERN_WARNING" does not
give a valid preprocessing token
do { if (rpc_debug & 0x0020) printk(KERN_WARNING "nfsd: fh_lock(%s)\n",
SVCFH_fmt(fhp) ); } while(0);
Are these warnings correct? If yes, is removing the ## in dfprintk the right
solution?
Franz.