1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-16 09:29:32 +00:00

Output a warning for a call to memset with a count of zero.

git-svn-id: svn://svn.cc65.org/cc65/trunk@2939 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2004-03-18 09:43:08 +00:00
parent be9ddfd33e
commit 1a9c9bf32f

View File

@ -188,6 +188,9 @@ static void StdFunc_memset (FuncDesc* F attribute ((unused)),
*/
Flags = ParseArg (Arg3Type, &Arg);
if (Flags & CF_CONST) {
if (Arg.ConstVal == 0) {
Warning ("Call to memset has no effect");
}
ExprLoad (CF_FORCECHAR, 0, &Arg);
}