Bad choice of preprocessor variable name

Dick Grune dick at tjalk.UUCP
Thu Jul 11 21:29:24 AEST 1985


In article <11428 at brl-tgr.ARPA> phil at RICE.ARPA (William LeFebvre) writes:
>I really like the idea of predefined preprocessor names that identify
>the architecture/os of the host, such as:  sun, vax, vax11c, etc....

> ... these may coincide with variable names ... [summary by dick at tjalk.UUCP]

>     .....                                      Guess what?!?  "struct
>sockaddr_un sun;"  Now try compiling that on a Sun!  It don't work too
>well.

You can have your cake and eat it: the new Amsterdam Compiler Kit C compiler
would have sun defined and replace it by sun.

					Dick Grune
					Vrije Universiteit
					de Boelelaan 1081
					1081 HV  Amsterdam
					the Netherlands



More information about the Comp.unix.wizards mailing list