[Issue 12619] New: Invalid warning for unused return value of debug memcpy
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Apr 22 15:24:46 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12619
Issue ID: 12619
Summary: Invalid warning for unused return value of debug
memcpy
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Keywords: diagnostic, rejects-valid
Severity: regression
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: bearophile_hugs at eml.cc
Technically this is a regression, but it's a minor one. Issue found by
CyberShadow:
void main() pure {
import core.stdc.string: memcpy;
ubyte[10] a, b;
debug memcpy(a.ptr, b.ptr, 5);
}
DMD 2.066alpha gives:
test2.d(4,17): Warning: Call to function core.stdc.string.memcpy without side
effects discards return value of type void*, prepend a cast(void) if
intentional
memcpy is weakly pure, so I think you should not get that warning, that I think
should be only for strongly pure functions.
--
More information about the Digitalmars-d-bugs
mailing list