[PATCH] D33716: Provide path to Solaris.h include (Bug 28370)

Fedor Sergeev via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 15:07:54 PDT 2017


On Fri, Jun 09, 2017 at 11:58:10PM +0200, Joerg Sonnenberger via llvm-commits wrote:
> On Fri, Jun 09, 2017 at 09:09:50PM +0000, Fedor Sergeev via Phabricator via llvm-commits wrote:
> > fedor.sergeev added a comment.
> > 
> > In https://reviews.llvm.org/D33716#772362, @krytarowski wrote:
> > 
> > > My personal opinion is that `-include` is the wrong way of doing the work.
> > 
> > 
> > While generally I would agree with this sentiment, there is one part of Solaris.h which is very hard to do w/o -include.
> > I mean all those #undef ES/DS register macro names, that pollute user space after including Solaris sys/regset.h.
> > You need to perform these undefs immediately after the first include of regset.h, otherwise you are doomed
> > to hit confusing results of the aforementioned pollution (that nobody else sees on other platforms!).
> 
> A sys/regset.h wrapper using #include_next might work just as well, if
> this is the only reason.

This wont work for system includes unless you have a full control over system include path
(with something like -isystem).
And that just switches the problem from -include to -isystem.

This is a hack anyway.
And thus -include is in a sense better since it makes the hack more obvious.

regards,
  Fedor.
PS I wonder why I dont see your reply as a reviews.llvm.org entry...

> 
> Joerg
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list