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


Austin Hastings <ah0801...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ah0801...@yahoo.com


--- Comment #8 from Austin Hastings <ah0801...@yahoo.com> 2010-10-03 18:40:49 
PDT ---
I encountered a similar problem. I was taking code I had written with ulongs
and trying to template-ize the code. For me, the code below prints "plain
error?".
======
import std.stdio;

void main() {
    uint foo = 0;

    plain_sub( foo );
}

int plain_sub( const uint value ) {

    if( uint t32 = value >> 32 ) {
        writeln( "plain error?" );
    }

    return 0;
}
=====
C99 says that shifts >= the width of the victim are undefined behavior. The D2
manual says shifting /more/ than the width of the victim is illegal. 

Apparently, shifting equal to the width is legal-but-surprising. I'd like it to
be either illegal, with a warning, or legal-but-not-surprising.

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

Reply via email to