[Issue 10522] New: __FILE__ and other special keywords cannot be used with printf

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 1 15:00:09 PDT 2013


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

           Summary: __FILE__ and other special keywords cannot be used
                    with printf
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-07-01 15:00:08 PDT ---
-----
import std.stdio;

void main()
{
    printf("-- %s\n", __FILE__);
    printf("-- %s\n", __FUNCTION__);
    printf("-- %s\n", __PRETTY_FUNCTION__);
}
-----

> object.Error: Access Violation

The use-case are printf statements in destructors, which unlike writef will
avoid any allocations (which typically fail in dtors due to the GC being
stopped).

-- 
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