Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Assorted C Questions Message-ID: <1989Sep6.160004.19253@utzoo.uucp> Organization: U of Toronto Zoology References: <4294@udccvax1.acs.udel.EDU> Date: Wed, 6 Sep 89 16:00:04 GMT In article <4294@udccvax1.acs.udel.EDU> gdtltr@vax1.acs.udel.EDU (Gary D Duzan) writes: >... how necessary are #if >directives? It seems to me that it adds too much complexity... They are a pain to implement, indeed; there are just enough differences between #if expressions and normal ones to make trouble for an attempt to use the same code. However, I think you will find that the utility of your compiler is *vastly* increased if it will compile most existing C programs. This means you have to implement pretty well all of the language. >#define min(x,y) (((x) < (y)) ? (x) : (y)) >foobar(min,max) >Sometype min,max; >{} > > Will this foul up the preprocessor... No; parameterized macro names are recognized as such *only* when followed immediately by "(". > Also, what exactly is a #pragma? ... It has a totally implementation-defined effect. It's up to *you*. If you just ignore them completely, that would be fine. -- V7 /bin/mail source: 554 lines.| Henry Spencer at U of Toronto Zoology 1989 X.400 specs: 2200+ pages. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu