[LLVMdev] [cfe-dev] Goal for 3.5: Library-friendly headers
Alp Toker
alp at nuanti.com
Sun Nov 10 10:07:45 PST 2013
On 10/11/2013 14:26, Joerg Sonnenberger wrote:
> On Sun, Nov 10, 2013 at 01:42:24PM +0000, Alp Toker wrote:
>> |#undef NetBSD||
>> ||#undef mips||
>> ||#undef sparc||
>> ||#undef INT64_MAX||
>> ||#undef alloca|
>>
>> This is not OK to do globally -- even if LLVM doesn't care about the
>> definition, maybe embedding applications or OS headers do?
> Given that 3 of the 5 #undefs are directly relevant for me -- they exist
> because OS headers and/or compiler default configurations provide legacy
> macros that can't easily be dropped without breaking old cruft. All
> modernish software is supposed to use the corresponding __ version of
> the names.
As an extra data point, clang itself pre-defines PSP, qdsp6, hexagon and
MSP430, and it looks from a web search that platform compilers have a
tradition of defining the platform and architecture like this so the
only reason #undef NetBSD is alone there is that you were the first to
compile on the less common platforms who actually bothered to submit a
patch.
The right fix would be to prefix the enumerands in Triple.h or move the
enums into a private header (probably not feasible because they're used
externally).
Alp.
>
> INT64_MAX as seen by the context is about a AIX specific header bug.
>
> alloca has a comment about VC++. Might be better to add a conditional
> around it and see if that solves the problem.
>
> In short, I don't see a real problem here.
>
> Joerg
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
--
http://www.nuanti.com
the browser experts
More information about the llvm-dev
mailing list