[llvm-bugs] [Bug 25871] New: Enum constants defined in Support/MachO.h conflict with system header

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 17 10:41:55 PST 2015


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

            Bug ID: 25871
           Summary: Enum constants defined in Support/MachO.h conflict
                    with system header
           Product: libraries
           Version: 3.7
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
          Assignee: unassignedbugs at nondot.org
          Reporter: dan at danburkert.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The OS X mach-o/loader.h system header defines a set of constants as macros,
and the LLVM Support/MachO.h header redefines those constants as enum variants
(MH_MAGIC is one example).  The result is that in applications that import both
headers, the enum identifier in Support/MachO.h is replaced with the value, and
compilation fails.

OS X system header:
https://opensource.apple.com/source/xnu/xnu-1456.1.26/EXTERNAL_HEADERS/mach-o/loader.h

LLVM header:
https://github.com/llvm-mirror/llvm/blob/856a0380260e2735f51b059822674bd47961c050/include/llvm/Support/MachO.h#L24-L80

-- 
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/20151217/80d9e739/attachment-0001.html>


More information about the llvm-bugs mailing list