Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!ima!mirror!xanth!kyle From: kyle@xanth.UUCP Newsgroups: comp.lang.c Subject: macro and variable name collisions Message-ID: <738@xanth.UUCP> Date: Tue, 24-Mar-87 20:29:30 EST Article-I.D.: xanth.738 Posted: Tue Mar 24 20:29:30 1987 Date-Received: Thu, 26-Mar-87 03:46:49 EST References: <7700002@iaoobelix.UUCP> Organization: odu computer science Lines: 23 Summary: i sympathize In article <7700002@iaoobelix.UUCP>, wagner@iaoobelix.UUCP writes: > > I have tried to run `screen' on a Sun. Well, the file screen.c contains a > variable called `sun'... > > You know what happened: `sun' gets replaced by `1' because we're running on a > Sun and cpp wants to indicate this!! I had a similar problem trying to make a sendmail header file with a #define DBM 1 in it, live with 4.3 BSD's ndbm.h, in which DBM is struct typedef! I had a devil of a time trying to figure out what was going on. It would be nice if cpp would allow programmers to write something like #define DBM DBM Anyone know of a better way to avoid such collisions, besides say, prepending an _ to macros #define'd that will only be used in later #ifdef's? kyle jones odu computer science, norfolk, va