This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Make cstddef / cstdarg more robust (PR 69881)
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 23 Feb 2016 10:00:58 +0000
- Subject: Re: [PATCH] Make cstddef / cstdarg more robust (PR 69881)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=hotmail.de;
- References: <HE1PR07MB0905BE8B57CCF6328BE2A52FE4A40 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com>,<20160223094232 dot GE3171 at redhat dot com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
On 23/02/15 10:42, Jonathan Wakely wrote:
>On 23/02/16 07:15 +0000, Bernd Edlinger wrote:
>>as described in the PR 69881 it happens quite often that cstddef is
>>called with __need_size_t because we still support gmp-4.3.2 which
>>is installed by contrib/download_prerequisites. This causes a kind
>>of undefined behavior. It is just by chance that this does not cause
>>the gcc-6 boot-strap to fail, but it causes gcc-4.9 bootstrap to fail
>>when the gcc-6 version of cstddef is around. So it looks like a
>>regression, because the new cstddef is more fragile than before.
>
>Is it? cstddef hasn't been changed since 2013-06-11. cstdarg hasn't
>been changed since 2011-01-30.
>
>What made them more fragile?
Good question.
The cstddef had this even in gcc.4.9 that's true, but it was not used
by default:
#if __cplusplus >= 201103L
namespace std
{
// We handle size_t, ptrdiff_t, and nullptr_t in c++config.h.
using ::max_align_t;
}
#endif
Previously the g++ default was --std=gnu++98,
but gcc-6 changed the default to --std=gnu++14.
And when building gcc-4.9, stage1 does not override that with
--std=gnu++98.
That has changed, and that triggers the latent bug.
Bernd.