[LLVMdev] [cfe-dev] Unexpected results from _Bool cast

Alistair Lynn arplynn at gmail.com
Sun Dec 5 02:30:00 PST 2010


Hello-

Yes, this is a bug. This code gives the expected result (1) for me under the current svn HEAD.

Alistair

On 5 Dec 2010, at 09:04, Dave Keck wrote:

> Hey list,
> 
> The following program outputs '0' when compiled on my system with `clang a.c`:
> 
>    #include <stdio.h>
>    int main(int argc, const char *argv[])
>    {
>        printf("%d\n", (_Bool)((void *)0xCAFEBABE));
>        return 0;
>    }
> 
> Could someone confirm this is a bug? (Section 6.3.1.2 of C99 seems to
> suggest that it is.) I suspect I need to upgrade Xcode/clang/llvm, but
> I thought I'd check before I attempt to download that monstrosity on
> my wee connection.
> 
> Thanks,
> 
> David
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the llvm-dev mailing list