Article View: gnu.gcc.bug
Article #1319Bugs in CPP 2.2.2
From: Andreas Schwab
Date: Mon, 09 Nov 1992 12:11
Date: Mon, 09 Nov 1992 12:11
42 lines
1346 bytes
1346 bytes
1. Hexadecimal numbers can confuse token parsing. ---- bug1.c #define A 1 int i = 0x2e+A; int j = 0x2e+ A; ---- Output of: gcc -E bug1.c ---- # 1 "bug1.c" int i = 0x2e+A; int j = 0x2e+ 1 ; ---- 2. Macro parameters which are only to be stringified or concatenated, but not exapanded are nevertheless expanded internally and can lead to errors and strange effects. ---- bug2.c #define k(a) #a char *s = k(k(1,2)); char *t = k(#) k(#undef k) k(x); /* feature?? */ ---- Output of: gcc -E bug2.c ---- bug2.c:3: macro `k' used with too many (2) args bug2.c:4: invalid preprocessor directive name # 1 "bug2.c" char *s = "k(1,2)" ; char *t = "#" "#undef k" k(x); ---- -- Andreas Schwab schwab@ls5.informatik.uni-dortmund.de
Technical Details
Message-ID:
<9211091011.AA03081@lamothe.informatik.uni-dortmund.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lamothe.informatik.uni-dortmund.de!schwabShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lamothe.informatik.uni-dortmund.de!schwab From: schwab@lamothe.informatik.uni-dortmund.de (Andreas Schwab) Subject: Bugs in CPP 2.2.2 Message-ID: <9211091011.AA03081@lamothe.informatik.uni-dortmund.de> Sender: gnulists@ai.mit.edu Reply-To: schwab@ls5.informatik.uni-dortmund.de (Andreas Schwab) Organization: GNUs Not Usenet Distribution: gnu Date: Mon, 9 Nov 1992 12:11:15 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 43