Undefined behaviors & Clang 3.3
    bearophile 
    bearophileHUGS at lycos.com
       
    Thu Jun 20 07:28:40 PDT 2013
    
    
  
Another nice post about the Integer Undefined Behavior Detection 
of Clang 3.3:
http://blog.regehr.org/archives/963
>Until these languages die, which isn’t going to happen anytime 
>soon, our best defense against undefined behaviors is to write 
>better checking tools.<
Some potential bugs it has found:
http://article.gmane.org/gmane.comp.fonts.freetype.devel/8817
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57324
http://blog.regehr.org/extra_files/perl-test-output.txt
Things like this in gcc:
gcc/gcc/simplify-rtx.c:4004:16: runtime error: signed integer 
overflow: -1844674407370955161 + -9223372036854775808 cannot be 
represented in type 'long'
gcc/gcc/stor-layout.c:2543:45: runtime error: signed integer 
overflow: -9223372036854775808 - 1 cannot be represented in type 
'long'
Is someone able to compile and run the dmd source code with Clang 
with "-fsanitize=undefined"?
And is it possible to add -fsanitize=undefined to ldc2?
Bye,
bearophile
    
    
More information about the Digitalmars-d
mailing list