AaronBallman wrote:

> > I could use a bit more background. It's a POSIX header, so a POSIX 
> > implementation should provide it.
> 
> To clarify some terminology, I believe clang _is_ part of our POSIX 
> implementation. The POSIX implementation includes the compiler and headers as 
> part of the specification and does not require the 
> [headers](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap14.html#tag_14)
>  be part in one specific part of the implementation or another.

Fair point.

> But I think the question you're asking is why this header belongs here in 
> clang and not in some other part of the implementation (e.g. libc). 

Yeah, that's really what I was trying to understand. :-)

> This header is very tied to compiler magic (i.e. BIFs) for it's efficient 
> implementation, in a way that's troublesome for a portable library 
> implementation to provide. Clang already vends a a number of similar headers 
> which meet these criteria which are included in POSIX .

Thanks, that's what I was missing! :-)

> > Providing it on non-POSIX systems leads to the question of why Clang 
> > (specifically) should vend this header.
> 
> As to why non-POSIX systems would also want this header vended in clang, I 
> think the answer is vending this header improves application portability at 
> little cost. This header relies on nothing outside clang, and performs byte 
> order conversion routines which are broadly useful and applicable regardless 
> of platform.

It can also degrade application portability too though; if the user moves from 
Clang to a different toolchain which doesn't vend the header (thinking of MSVC 
as a potential example), then the user is surprised this header doesn't exist. 
But that said, we already vend POSIX headers for the reasons you listed above 
and none of these interfaces require runtime support, so it seems reasonable to 
me.

https://github.com/llvm/llvm-project/pull/186032
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to