Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mtune!codas!usfvax2!chips From: chips@usfvax2.UUCP (Chip Salzenberg) Newsgroups: comp.lang.c Subject: Re: Style question re common C expression. Message-ID: <782@usfvax2.UUCP> Date: Mon, 22-Jun-87 17:00:44 EDT Article-I.D.: usfvax2.782 Posted: Mon Jun 22 17:00:44 1987 Date-Received: Thu, 25-Jun-87 03:11:49 EDT References: <4934@utcsri.UUCP> <8164@utzoo.UUCP> Organization: AT Engineering, Tampa, FL Lines: 14 Keywords: STREQ Summary: When are parens needed on macro parameters? In article <8164@utzoo.UUCP>, henry@utzoo.UUCP writes: > > ... like the standard "#define STREQ(s,t)(strcmp(s,t) == 0)"? > > [Note:] > First, that should be "(strcmp((s),(t)) == 0)" for safety's sake, although > in this case trouble is unlikely. I can't think of any situation which could break the macro given by Henry. In a spirit of curiosity -- can you come up with an invocation of the above- quoted "STREQ(s,t) (strcmp(s,t)==0)" macro that would not behave as expected? -- Chip Salzenberg Address: "{gatech,cbatt,akgua}!usfvax2!ateng!chip" AT Engineering, Tampa, FL Redress: "chips@usfvax2.UUCP" "Use the Source, Luke!" My opinions do not necessarily agree with anything.