[Bug 123] New: Use of function, modulus, and dollar sign (length) fails to compile with static and const

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 1 18:39:35 PDT 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=123

           Summary: Use of function, modulus, and dollar sign (length) fails
                    to compile with static and const
           Product: D
           Version: 0.157
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: link-failure
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: CppCoder at gmail.com


uint intRes()
{
        return 4;
}

int main()
{
        static const char []foo = "abc123";
        //everything works as expected if static and const are removed.
        writefln( "%c", foo[intRes() % $] );

        return 0;
}

linking fails:
main.obj(main)
 Error 42: Symbol Undefined _Dmain8__dollark
--- errorlevel 1


-- 




More information about the Digitalmars-d-bugs mailing list