Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!hp4nl!philapd!ssp9!dolf From: dolf@idca.tds.PHILIPS.nl (Dolf Grunbauer) Newsgroups: comp.lang.c Subject: Comment in #define's Message-ID: <583@ssp9.idca.tds.philips.nl> Date: 5 Feb 91 07:42:23 GMT Reply-To: dolf@idca.tds.philips.nl (Dolf Grunbauer) Organization: Philips Information Systems, Apeldoorn, The Netherlands Lines: 28 I've just had a (lint) problem. Somehow lint kept complaining about not using a return value. It turned out that this was due to a comment in a #define which was removed. I thought this was wrong, but now I am not so sure anymore. The code looked like: #define ERROR(x,v) if (x) {/*RVALUSED*/ send_answer(v); return} void somefunc(a,c) { ERROR(a == 0, 1); /* 1 */ if (c) {/*RVALUSED*/ send_answer(2); return} /* 2 */ ... } Statement 1 gave the error, while 2 was accepted without warnings. Now I am wondering what should happen when the source file is run through only through the preprocessor while the comments should stay in (flags: -E -Wp,-C): is the comment in the #define supposed to be removed or not ? What does ANSI-C say about this ? BTW I solved the problem by using '(void)' in the define, so I don't need any solutions to fix this particular problem :-) -- _ _ / U | Dolf Grunbauer Tel: +31 55 433233 Internet dolf@idca.tds.philips.nl /__'< Philips Information Systems UUCP ...!mcsun!philapd!dolf 88 |_\ If you are granted one wish do you know what to wish for right now ?