Unexpected behavior of dmd -H switch

Jarrett Billingsley kb3ctd2 at yahoo.com
Sat Aug 23 21:30:48 PDT 2008


"Sergey Gromov" <snake.scaly at gmail.com> wrote in message 
news:MPG.231ad584323c5e919896ac at news.digitalmars.com...

> 1. the constant should be 3758096384u

I can at least answer number 1.  Syntactically, numeric literals do not 
include the sign.  When you write "-5" it's actually parsed as a negation 
performed on a positive integer.  The semantic pass performs constant 
folding and turns it into an actual negative integer.  So yes, -5u is legal 
from a syntactic point of view.  I wasn't entirely aware that negation could 
be performed on unsigned integers, though. 




More information about the Digitalmars-d-learn mailing list