Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!nrl-cmf!ames!amdahl!uunet!unh!jeff From: jeff@unh.UUCP (Jeffrey E. F. Friedl) Newsgroups: comp.lang.c Subject: Re: Strange cc warning Message-ID: <898@unh.UUCP> Date: 1 Feb 89 06:21:55 GMT References: <490@marob.MASA.COM> Organization: University of New Hampshire, Durham, NH Lines: 37 In article <490@marob.MASA.COM>, daveh@marob.MASA.COM (Dave Hammond) writes: about this strict warning from his compiler: > ../include/dsipriv.h(88) : warning 74: > non standard extension used - 'macro formals in strings' > > The macro in question is defined as follows: > > /* copy IN to OUT for LEN chars, enclosing OUT in dbl. quotes */ > #define REQUOTE(in, out, len) if ((in) && (out)) { \ > *(out) = '"'; \ > Line 88 -------------------> strncpy((out)+1, (in), (len)); \ > (out)[(len)-1] = 0; \ > strcat((out), "\""); \ > (in) = (out); } > > [it works fine, but why the warning?] Looks to me as if your preprocessor is not very smart about quotes. Perhaps it thinks that the double quote in line 87 is the beginning of a string (which it would then match with quote #1 in line 90). It thinks it's the same situation as if you had something like #define parenthesize_string_literal(WORD) "(WORD)" or some such thing. Gee, when a preprocessor doesn't know the difference between " and '"'... Since you asked about the warning, I won't offer my comments about the macro itself, although I'd love to.... [(-:]. *jeff* ------------------------------------------------------------------------------ Jeffrey Eric Francis Friedl Box 2173 Babcock House ..!{uunet,decvax}!unh!jeff Durham New Hampshire 03824 So, Steve, how's that '89 Mustang GT Convertible doin'?