Path: utzoo!attcan!uunet!lll-winken!lll-tis!mordor!joyce!ames!mailrus!nrl-cmf!cmcl2!phri!marob!daveh From: daveh@marob.MASA.COM (Dave Hammond) Newsgroups: comp.lang.c Subject: Calling multiple functions in a macro. Message-ID: <353@marob.MASA.COM> Date: 31 Oct 88 15:29:10 GMT Reply-To: daveh@marob.masa.com (Dave Hammond) Organization: ESCC New York City Lines: 19 In attempting to construct a macro which calls several functions, but can be used as a single statement (i.e. without braces in an if/else construct), I can see 2 possible alternatives: 1. #define FOO() do { foo1(); foo2(); foo3() foo4(); } while(0) 2. #define FOO() foo1(), foo2(), foo3(), foo4() The first adds quite a bit of code to the program and makes lint complain about constants in conditional text. The second compiles, executes and lints correctly (on Xenix), but is it portable to string function calls in this manner? Dave Hammond UUCP: ...!uunet!masa.com!{marob,dsix2}!daveh DOMAIN: daveh@marob.masa.com ----------------------------------------------------------------------------