gcc 3.4 Compiler warning

Falk Hueffner falk.hueffner@student.uni-tuebingen.de
Tue Feb 17 10:45:00 GMT 2004


Christian Ehrlicher <ehrlicher@deneg.de> writes:

> I got following warning where I don't expect.
> "null argument where non-null required (arg 2)"
> 
>      memmove(tmp1,0,MY_RET_DEF_SIZ(0));
> 
> It works because MY_RET_DEF_SIZ return 0 and so I think the warning
> isn't usefull there.

The warning is correct; the standard requires a valid pointer even if
the length is zero. This is not very likely to cause problems with
actual implementations, though.

-- 
	Falk



More information about the Gcc-help mailing list