[LLVMdev] UnitTests/2003-05-31-CastToBool.c

Vladimir Prus ghost at cs.msu.su
Wed Jul 7 06:54:01 PDT 2004

I think test/Programs/SingleSource/UnitTests/2003-05-31-CastToBool.c
has a problem. Consider:

     void testLong(long long X) {
        printf("%ld ", X);
        testBool(X != 0);

This passes 'long long' value to 'ld' format specifier -- but for that 
specifier the parameter should be 'long'. So, the behaviour of the above is 
undefined and in fact it produces wrong results with my backend.

Could extra 'l' be added in the format string?

- Volodya

More information about the llvm-dev mailing list