Displaying 2 results from an estimated 2 matches for "testlong".
Did you mean:
testlog
2004 Jul 07
2
[LLVMdev] UnitTests/2003-05-31-CastToBool.c
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...
2004 Jul 07
0
[LLVMdev] UnitTests/2003-05-31-CastToBool.c
...lly correct :)
Most modern C/C++ compilers will detect this for you at compile time.
What compiler are you using?
Reid.
On Wed, 2004-07-07 at 04:51, Vladimir Prus wrote:
> 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
> undef...