www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5874] New: alloca should be pure

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5874

           Summary: alloca should be pure
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com



import core.stdc.stdlib;

void doAlloca() pure {
    alloca(8);
}

void main() {
    doAlloca();
}

Error: pure function 'doAlloca' cannot call impure function 'alloca'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 23 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5874


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc



I approve of this.

In the meantime a workaround is to use a extern in the module (it's not
 trusted):

extern(C) pure nothrow void* alloca(in size_t size);

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