Path: utzoo!mnetor!uunet!husc6!necntc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Quote without comment on char constant expansion Message-ID: <3432@haddock.ISC.COM> Date: 12 Apr 88 17:52:55 GMT References: <4418@hoptoad.uucp> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 25 In article <4418@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes: >[sun!sunuk!pan!aratar!chac (Chuck Clanton) writes:] >> #define blah(t) 't' >>[gcc gives you 't', pcc and vcc and some others expand the argument] >>it would seem that gcc is outvoted ... [k&r is unclear on this] ... >>i am not sure where ansi sits on this one. vcc and gcc both claim to be >>ansi compatible. gcc is right (from the ANSI view); vcc is not a conforming implementation. >>this is from the system 5 assert.h: >> #define assert(EX) if (EX) ; else _assert("EX", __FILE__, __LINE__) This will have to be fixed for the ANSI implementation of assert(). The original problem showed up in BSD . I would recommend that this header be fixed as shown by the example below. old> #define _IO(x,y) (IOC_VOID|('x'<<8)|y) old> #define TIOCHPCL _IO(t, 2) new> #define _IO(x,y) (IOC_VOID|(x<<8)|y) new> #define TIOCHPCL _IO('t', 2) Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint