Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!ukc!dcl-cs!gdt!gdr!exspes From: exspes@gdr.bath.ac.uk (P E Smee) Newsgroups: comp.lang.c Subject: Re: Directives in comments Message-ID: <1989Dec22.101213.3440@gdt.bath.ac.uk> Date: 22 Dec 89 10:12:13 GMT References: <25234@cup.portal.com> Reply-To: exspes@gdr.bath.ac.uk (P E Smee) Organization: University of Bristol c/o University of Bath Lines: 24 In article <25234@cup.portal.com> compata@cup.portal.com (David H Close) writes: >The following program fragment appears to conform to the rules stated. > > /* > * Program heading > #define hdr "Program name" > * end of heading > */ > main () { printf(hdr); } > >However, the SCO compiler produces the following error message. > > t.c(6) : error 65: 'hdr' : undefined Common folklore has it that comments are stripped out (and always have been) BEFORE the preprocessor sets to work, so that your #define disappears before the preprocessor sees it. However, I can't find anything in either K&R-1 or K&R-2 which specifically SAYS that. The behaviour you mention certainly doesn't surprise me, though. -- Paul Smee, Univ of Bristol Comp Centre, Bristol BS8 1TW, Tel +44 272 303132 Smee@bristol.ac.uk :-) (..!uunet!ukc!gdr.bath.ac.uk!exspes if you MUST)