On Wed, 18 Jun 2025, Gábor Németh wrote:

> > If normal user code that includes <limits> gets this warning (built with
> > an installed compiler), that needs fixing in some way.  If not, what is
> > different about how GCC uses its own libstdc++?  (For example, it's
> > important to include system headers with -isystem not -I, does GCC get
> > this right when building with the libstdc++ from a previous stage of
> > bootstrap?)
> 
> No, normal user code doesn't get the warning, only gcc.  On your clue I
> checked stage 2 flags though, and it turns out that libstdc++ headers are
> normally included with -I, except with -isystem in lean mode. (Indeed, `make
> bootstrap-lean` builds fine with my patch 2/2 sans the changes to compile
> flags, whereas `make bootstrap` fails without them.) The differentiation
> between normal and lean modes were added in [1] as a fix for PR58572 [2],
> before which it was always -I since forever [3].
> 
> I can create a separate patch to use -isystem unconditionally, however there
> seems to be a contradiction between what you're stating about its use and what
> earlier authors did.  Can you advise?

I think it makes no sense for the use of -isystem to be conditional on 
bootstrap-lean and it should always be used when including what are 
logically system headers.

-- 
Joseph S. Myers
josmy...@redhat.com

Reply via email to