From: cuz Date: Thu, 18 Mar 2004 09:43:08 +0000 (+0000) Subject: Output a warning for a call to memset with a count of zero. X-Git-Tag: V2.12.0~883 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1a9c9bf32f33159dc812c8eb18f46ef8ec885c21;p=cc65 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 --- diff --git a/src/cc65/stdfunc.c b/src/cc65/stdfunc.c index f1fef71aa..763c895ce 100644 --- a/src/cc65/stdfunc.c +++ b/src/cc65/stdfunc.c @@ -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); }