[Bug libstdc++/69881] with gcc-6 of today building gcc-4.9 fails
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 22 11:19:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69881
--- Comment #18 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Bernd Edlinger from comment #13)
> (In reply to Jonathan Wakely from comment #12)
> > (In reply to Bernd Edlinger from comment #9)
> > > right now I am trying to boot-strap this:
> > >
> > > Index: c/cstddef
> > > ===================================================================
> > > --- c/cstddef (revision 233581)
> > > +++ c/cstddef (working copy)
> > > @@ -31,10 +31,11 @@
> > >
> > > #pragma GCC system_header
> > >
> > > -#define __need_size_t
> > > -#define __need_ptrdiff_t
> > > -#define __need_NULL
> > > -#define __need_offsetof
> > > +#undef __need_wchar_t
> > > +#undef __need_size_t
> > > +#undef __need_ptrdiff_t
> > > +#undef __need_NULL
> > > +#undef __need_wint_t
> > > #include_next <stddef.h>
> >
> >
> > How do you plan to test this change? Do you have a target that uses this
> > header?
> >
>
> Yes, I do have such targets.
> We use eCos at Softing as real time O/S a lot.
Great, that's good to know.
> I think I will build an ecos cross compiler, did so last year with
> gcc-5.1, (and had quite a lot of trouble with the bugs in
> ecos headers)
>
> ./gcc-5.1.0/configure --prefix=/home/ed/gnu/arm-eabi --target=arm-eabi
> --with-newlib --enable-languages=c,c++ --disable-hosted-libstdcxx
> --disable-__cxa-atexit --disable-libquadmath --disable-decimal-float
>
> >
> > > #endif
> > > Index: c_global/cstddef
> > > ===================================================================
> > > --- c_global/cstddef (revision 233581)
> > > +++ c_global/cstddef (working copy)
> > > @@ -41,6 +41,11 @@
> > >
> > > #pragma GCC system_header
> > >
> > > +#undef __need_wchar_t
> > > +#undef __need_size_t
> > > +#undef __need_ptrdiff_t
> > > +#undef __need_NULL
> > > +#undef __need_wint_t
> > > #include <bits/c++config.h>
> > > #include <stddef.h>
> >
> > This isn't incorrect, but it should not be necessary. This macros are
> > internal implementation details of the standard library headers, and user
> > code (like GMP) should not be defining those macros. If GMP wants size_t it
> > should include <stddef.h> and if it wants std::size_t it should include
> > <cstddef>, and it should not try to play silly games to only get part of the
> > header.
> >
> >
>
> Yeah, shit happens.
> Anyway boot-strap & reg-testing OK on x86_64-pc-linux-gnu.
> gcc-4.9 builds successfully (minus Ada, see pr69883 :()
I'm in two minds whether we should fix that shit in the library or not.
> > > Index: c_std/cstddef
> > > ===================================================================
> > > --- c_std/cstddef (revision 233581)
> > > +++ c_std/cstddef (working copy)
> > > @@ -41,6 +41,11 @@
> > >
> > > #pragma GCC system_header
> > >
> > > +#undef __need_wchar_t
> > > +#undef __need_size_t
> > > +#undef __need_ptrdiff_t
> > > +#undef __need_NULL
> > > +#undef __need_wint_t
> > > #include <bits/c++config.h>
> > > #include <stddef.h>
> >
> > How do you plan to test this?
>
> no idea yet.
> under what condition is that header used?
For targets that choose to use it or with --enable-cheaders=c_std, but I don't
know of any targets where that is the default or needed, so don't know how to
test it. It is to be expected that you can't just use --enable-cheaders=c_std
on a target where that isn't usually used (and I'm not surprised if those
headers are also currently broken).
> Why does it only differ in the comment from the
> previous header?
>
> why are the both files different?
> diff c_global/cstddef c_std/cstddef
> 26c26
> < * This is a Standard C++ Library file. You should @c \#include this file
> ---
> > * This is a Standard C++ Library file. You should @c #include this file
>
> is this a mistake?
Maybe. It's only a comment, I'm not very concerned.
More information about the Gcc-bugs
mailing list