bearophile wrote:
Lars T. Kyllingstad:
I think the compiler should be smart enough to figure this out for
itself, but until that happens you can work around it by suffixing at
least one of the integer literals with LU, so the compiler interprets
the entire expression as an ulong:
To make
Steven Schveighoffer:
This is not a bug, and will probably not be changed (it's been this way
since C). It is impossible for the compiler to know whether you wanted
sign extension or not, as some code depends on sign extension.
I'd like overflow errors bot at compile and run-time, to
Lars T. Kyllingstad:
I think the compiler should be smart enough to figure this out for
itself, but until that happens you can work around it by suffixing at
least one of the integer literals with LU, so the compiler interprets
the entire expression as an ulong:
To make this fix happen
bearophile wrote:
Lars T. Kyllingstad:
I think the compiler should be smart enough to figure this out for
itself, but until that happens you can work around it by suffixing at
least one of the integer literals with LU, so the compiler interprets
the entire expression as an ulong:
To make