Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!udel!udccvax1!gdtltr From: gdtltr@vax1.acs.udel.EDU (Gary D Duzan) Newsgroups: comp.lang.c Subject: Assorted C Questions Message-ID: <4294@udccvax1.acs.udel.EDU> Date: 2 Sep 89 20:45:08 GMT Organization: Galadrim (really a disorganization) Lines: 35 In may spare time I am starting work on a fairly minimal C compiler for a fairly minimal system. No flames, please, I am doing this for experience and fun (not to mention the fact that this system has no real C compiler available). I have just about finished my preprocessor/tokenizer and am putting it through some tests. My first question is: how necessary are #if directives? It seems to me that it adds too much complexity to the preprocessor. I may add it later, but I think it is a bit too much trouble at this stage. Now for a more important question about macros. Is this legal? #define min(x,y) (((x) < (y)) ? (x) : (y)) foobar(min,max) Sometype min,max; {} Will this foul up the preprocessor since min doesn't have the parameter list in the function declaration? Also, what exactly is a #pragma? An example would help. I am working from K&R Second Edition and it doesn't say much on the subject. Gary Duzan Time Lord Third Regeneration -- _o_ _o_ [|o o|] "Two hearts are better than one." -- Yes [|o o|] |_O_| "Don't listen to me; I never do." -- Doctor Who |_O_|