https://bugs.llvm.org/show_bug.cgi?id=40192

            Bug ID: 40192
           Summary: Document trap representations of _Bool
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Documentation
          Assignee: unassignedclangb...@nondot.org
          Reporter: gonzalob...@gmail.com
                CC: llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Compiling

unsigned int foo(unsigned int x, _Bool b) {
    return x - (unsigned int)b;
}

only produces correct results if the value of `_Bool` is either `0` or `1`, see
https://gcc.godbolt.org/z/IqjQ-- :

foo:   # @foo
        mov     eax, edi
        sub     eax, esi
        ret

This probably means that all other representations of `_Bool` are trap
representations, but this does not appear to be documented anywhere. 

>From my reading of the C standard, the role that padding bits play for `_Bool`
is unclear.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to