[llvm-bugs] [Bug 45365] New: ppc64le: including <stdbool.h> prior to <altivec.h> causes compilation to fail in C mode

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 30 17:07:35 PDT 2020


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

            Bug ID: 45365
           Summary: ppc64le: including <stdbool.h> prior to <altivec.h>
                    causes compilation to fail in C mode
           Product: clang
           Version: 10.0
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: clang at evan.coeusgroup.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

This is trivial to reproduce:

  #include <stdbool.h>
  #include <altivec.h>

And compile with clang (not clang++).  The result is lots of "error: unknown
type name 'vector'".

AFAICT the problem is that stdbool.h defines bool to _Bool, then gets confused
when using types like "vector bool char" (which is "vector _Bool char" after
preprocessing).

I'm not really sure why, but it works in GCC.  Maybe they just treat _Bool the
same as bool for AltiVec.  It would be really nice if clang worked, too.

-- 
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/20200331/1d88adaf/attachment-0001.html>


More information about the llvm-bugs mailing list