[llvm-bugs] [Bug 40192] New: Document trap representations of _Bool

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 31 06:31:15 PST 2018


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: unassignedclangbugs at nondot.org
          Reporter: gonzalobg88 at gmail.com
                CC: llvm-bugs at lists.llvm.org, richard-llvm at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181231/73cbef61/attachment.html>


More information about the llvm-bugs mailing list