Strange cc warning

Dave Hammond daveh at marob.MASA.COM
Tue Jan 31 09:21:05 AEST 1989


Ok, I've racked my brain long enough on this one.

System is a vanilla 386 running SCO Xenix 2.3 -- when compiling with
the standard warning level (-W 1) I get no warnings at all;  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'

(I inserted the newline after "warning 74:" for readability)
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); }

Note that this is a warning, not an error.  The program compiles fine
and the macro does as intended.  If any kind soul can clue me as to the
problem in the above macro, I'd be for(;;) indebted.

--
Dave Hammond
...!uunet!masa.com!{dsix2,marob}!daveh



More information about the Comp.lang.c mailing list