From 1a9c9bf32f33159dc812c8eb18f46ef8ec885c21 Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 18 Mar 2004 09:43:08 +0000 Subject: [PATCH] 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 --- src/cc65/stdfunc.c | 3 +++ 1 file changed, 3 insertions(+) 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); } -- 2.39.5