[Issue 4132] New: Bug? Pointer advancing is possible.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 28 09:21:01 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4132

           Summary: Bug? Pointer advancing is possible.
           Product: D
           Version: future
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: rayerd.wiz at gmail.com


--- Comment #0 from Haruki Shigemori <rayerd.wiz at gmail.com> 2010-04-28 09:21:00 PDT ---
void main() @safe
{
    int a;
    int* p = &a;
    p++;
}

This code is able to compile.



* References [http://www.digitalmars.com/d/2.0/function.html]

- Safe Functions

Safe functions are marked with the @safe attribute.

The following operations are not allowed in safe functions:

- No casting from a pointer type to any type other than void*.
- No casting from any non-pointer type to a pointer type.
- No modification of pointer values. <-------------------------------- here!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list