[Issue 2818] New: Pointer parameters in core.memory should be const(void)*.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Apr 7 11:10:20 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2818
Summary: Pointer parameters in core.memory should be
const(void)*.
Product: D
Version: 2.027
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: dsimcha at yahoo.com
In core.memory, functions that do not affect the validity or contents of the
underlying memory regions should have signatures of ReturnType function(const
void*), not ReturnType function(void*). These include GC.sizeOf(), GC.addrOf(),
and GC.realloc(). There is simply no reason why these would be unsafe to call
on pointers to const/immutable objects, and as such, this should not require an
explicit cast.
--
More information about the Digitalmars-d-bugs
mailing list