[cfe-dev] [PROPOSAL] Reintroduce guards for Intel intrinsic headers

Vedant Kumar vsk at apple.com
Thu Jul 30 11:27:21 PDT 2015


> On Jul 30, 2015, at 10:33 AM, Eric Christopher <echristo at gmail.com> wrote:
> 
>> I don't see any downsides to reintroducing these guards.
> 
> Then you weren't really paying attention to the point of removing them :)
> 
> The idea is so that the headers can be used, with appropriate target attributes, for any code.

Right, I thought about this but wasn't sure if there were benefits to having symbols available for an unsupported target.

I.e, is there some reason a project might want to include the header for SSE4 intrinsics if it can't use any of those symbols?

> What kind of file is this? Keep in mind that things in the global namespace prefixed with an underscore is a reserved name for implementers as well. That would make this code not standards compliant as well.

It's a utility header in a C project.

> I'm sympathetic to users who are probably implementing a compatibility layer here and don't want to write their own intrinsic wrappers, but I think the right tradeoff is probably to fix the code.

Ok. It seems like the consensus is that Eric's patch does the right thing -- and I actually agree with that.

I'm just not 100% convinced that removing the header guards was necessary (which, I admit, could just be due to a lack of understanding on my part).

I checked with gcc trunk and they've taken the same approach, so at least it'll all be consistent.

vedant



More information about the cfe-dev mailing list