Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!xanth!nic.MR.NET!umn-cs!julius.cs.umn.edu!goers From: goers@julius.cs.umn.edu Newsgroups: comp.sys.mac.programmer Subject: ?Bug? in LsC Preprocessor. Keywords: LsC, C, Preprocessor Message-ID: <11796@umn-cs.CS.UMN.EDU> Date: 27 Mar 89 23:25:13 GMT Sender: news@umn-cs.CS.UMN.EDU Reply-To: goers@umn-cs.cs.umn.edu (Kenny Goers) Distribution: usa Organization: University of Minnesota, Minneapolis, CSci Dept. Lines: 46 References: Ho Netland, I'm having a problem with a macro in LsC. The following macro is preprocessed "correctly" with the Sun and Sequent C preprocessors but in LsC I get just a syntax error. #define check_size(name) \ if (e_/**/name >= l_/**/name) { \ register nsize = l_/**/name-s_/**/name+400; \ name/**/buf = (char *) realloc(name/**/buf, nsize); \ e_/**/name = name/**/buf + (e_/**/name-s_/**/name) + 1; \ l_/**/name = name/**/buf + nsize - 5; \ s_/**/name = name/**/buf + 1; \ } I have tried to find any referances to whether this is valid for a standard preprocessor but K&R don't get very specific about legal substitution just say not in double quotes. Could anyone on the net tell me what could be happening here? Included are below are the unpreprocessed version, and the version after going through the preprocessor on a Sun system (I added indentation to it to make it readable, otherwise it just sat on one line). Thanks for any help you can give. Kenny Goers goers@umn-cs.cs.umn.edu /* Before Preprocess */ main() { check_size(code); } --- /* After Preprocess on Sun 3.5 system */ main() { if (e_code >= l_code) { register nsize = l_code-s_code+400; codebuf = (char *) realloc(codebuf, nsize); e_code = codebuf + (e_code-s_code) + 1; l_code = codebuf + nsize - 5; s_code = codebuf + 1; }; }