Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!burl!codas!killer!chip From: chip@killer.UUCP Newsgroups: comp.unix.questions Subject: Re: Brain-dead Unix tutor needs quick help (-1) Message-ID: <2156@killer.UUCP> Date: Thu, 19-Nov-87 20:12:44 EST Article-I.D.: killer.2156 Posted: Thu Nov 19 20:12:44 1987 Date-Received: Sat, 21-Nov-87 19:06:43 EST References: <387@cogen.UUCP> <6700@brl-smoke.ARPA> Reply-To: chip@killer.UUCP (Chip Rosenthal) Organization: The Unix(tm) Connection BBS, Dallas, Tx Lines: 28 Summary: where this bit me In article <6700@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >For similar reasons, usually the arguments of a macro should be >wrapped with parentheses in the macro definition: > #define ZZZ(i,j) ((i) * (j)) >to prevent surprises with usages such as > ZZZ(a+1,b+1) I always assumed the golden rule "wrap macros in parens", until the following bit me: #ifdef INTERN # define EXTERN # define INIT(X) =(X) #else # define EXTERN extern # define INIT(X) #endif EXTERN char message[] INIT("hello world"); This got me on our SVR2 Edge machine (with Greenhill C I think), which didn't like parens around a string. Can anybody say whether or not it is reasonable to do this? -- Chip Rosenthal, Dallas Semiconductor, (214) 450-0400, ...killer!vector!chip This message courtesy of ``The UNIX Connection BBS'' in Dallas. Neither they nor my employer are responsible for my stupidity.