mirror of
https://github.com/cc65/cc65.git
synced 2025-01-27 09:33:42 +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:
parent
be9ddfd33e
commit
1a9c9bf32f
@ -188,6 +188,9 @@ static void StdFunc_memset (FuncDesc* F attribute ((unused)),
|
|||||||
*/
|
*/
|
||||||
Flags = ParseArg (Arg3Type, &Arg);
|
Flags = ParseArg (Arg3Type, &Arg);
|
||||||
if (Flags & CF_CONST) {
|
if (Flags & CF_CONST) {
|
||||||
|
if (Arg.ConstVal == 0) {
|
||||||
|
Warning ("Call to memset has no effect");
|
||||||
|
}
|
||||||
ExprLoad (CF_FORCECHAR, 0, &Arg);
|
ExprLoad (CF_FORCECHAR, 0, &Arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user