Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!bionet!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!kth!draken!tut!hydra!hylka!teittinen From: teittinen@cc.helsinki.fi Newsgroups: comp.lang.c Subject: Re: Strange cc warning Message-ID: <1709@cc.helsinki.fi> Date: 2 Feb 89 12:22:32 GMT References: <490@marob.MASA.COM> Organization: University of Helsinki Computing Centre Lines: 28 In article <490@marob.MASA.COM>, daveh@marob.MASA.COM (Dave Hammond) writes: > when > I switch to the next higher warning level (-W 2) the following completely > unobvious warning appears: > > .../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) = '"'; \ This is wrong ---------------------------^^^ > Line 88 ---------------------> strncpy((out)+1, (in), (len)); \ > (out)[(len)-1] = 0; \ > strcat((out), "\""); \ > (in) = (out); } You may not use quote character (") in character variable. The part I've marked should be '\"' and then you should not get any warnings. -----------------------------------+------------------------------------------- EARN: teittinen@finuh I "Studying is the only way to do nothing Internet: teittinen@cc.helsinki.fi I without anyone complaining about it." -----------------------------------+------------------------------------------- Marko Teittinen, student of computer science -------------------------------------------------------------------------------