https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69881

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(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?


>  #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.



> 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?

Reply via email to