Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site cvl.UUCP
Path: utzoo!linus!philabs!seismo!rlgvax!cvl!jcw
From: jcw@cvl.UUCP
Newsgroups: net.micro
Subject: Warning about CI-C86 #define
Message-ID: <460@cvl.UUCP>
Date: Sat, 2-Jul-83 14:34:00 EDT
Article-I.D.: cvl.460
Posted: Sat Jul  2 14:34:00 1983
Date-Received: Sun, 3-Jul-83 04:27:03 EDT
Organization: U. of Md. Computer Vision Lab
Lines: 18

One thing I found out about the Computer Innovations C compiler
preprocessor phase when trying to port some of my code that worked
on a UN*X C compiler was an inconsistancy in function macros.
When you say
   #define func(x,y) text ...
all occurences of the parameters of the strings "x" and "y" in the
text are substituted for, not just where identifiers appear.  For
example,
   #define debug(f) fprintf(stderr,"%s\n",f)
   debug("Hello");
would become:
   "Hello"print"Hello"(stderr,"%s\n","Hello");

which can really screw things up.  My advice is to use long names for
the formal parameters in a #define, which is unfortunately the opposite
of what people are inclined to use.
                                    -Jay Weber
{...!seismo!rlgvax!cvl!jcw}