[Issue 4835] DMD should warn about integer overflow in computed constant

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 7 12:39:35 PDT 2010


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


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #1 from bearophile_hugs at eml.cc 2010-09-07 12:39:13 PDT ---
I'm asking for overflow detection for years (both at compile-time and
run-time).

Again here the C language is better than the D language:

// C code
#include "stdio.h"
int main() {
    long long x = 1024 * 1024 * 1024 * 6;
    printf("%lld\n", x);
    return 0;    
}


GCC 4.3.4 gives:
prog.c: In function ‘main’:
prog.c:3: warning: integer overflow in expression

D compiler is not _practical_ enough yet.

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