This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] Remove uses of <cstddef> as an implementation detail
Paolo Carlini wrote:
> Hi,
>
>> Well, YaST says that glibc 2.9-2.12.1 (all automatic updates installed)
>> is installed on my machines, and they do show these problems. glibc 2.9
>> was released on Nov 13, 2008, but the bug was fixed only on Dec 29,
>> 2008. So there might also be affected systems running glibc 2.9, and I
>> really wonder why it worked on any openSuse 11.1.
>>
>> <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44417>
>
> Personally, I may have tested on a 11.2, instead of an 11.1, I don't
> remember now, sorry. Anyway, no reason to panic, later today I will
> correct that remain glitch in testsuite_allocator.h and we should be ok.
The smallest patch that seems (make check is not done yet, but has
passed thousands of tests okay) to fix the problem for me, is attached.
There might be more elegant ones, but problems also appear in
/libsupc++/cxxabi.h, so it is not enough to prefix occurrences of
ptrdiff_t in the testsuite files.
> To be super-safe I will also double check that the library nowhere
> includes <wchar.h> before <stddef.h>, actually it should be mostly
> matter of tweaking <cwchar> and forcing it the redundant include for
> glibc 2.9 systems. That should also allow us to remove the wa put in
> place by Jason. Johannes, then, before closing the PR I will be looking
> for your confirmation that thing are actually fine with 2.9, I can't do
> that myself right now.
Okay.
Johannes
Index: testsuite/util/testsuite_allocator.h
===================================================================
--- testsuite/util/testsuite_allocator.h (revision 160310)
+++ testsuite/util/testsuite_allocator.h (working copy)
@@ -242,7 +242,7 @@
{
public:
typedef size_t size_type;
- typedef ptrdiff_t difference_type;
+ typedef std::ptrdiff_t difference_type;
typedef Tp* pointer;
typedef const Tp* const_pointer;
typedef Tp& reference;
Index: testsuite/util/testsuite_hooks.h
===================================================================
--- testsuite/util/testsuite_hooks.h (revision 160310)
+++ testsuite/util/testsuite_hooks.h (working copy)
@@ -47,6 +47,7 @@
#ifndef _GLIBCXX_TESTSUITE_HOOKS_H
#define _GLIBCXX_TESTSUITE_HOOKS_H
+#include <stddef.h>
#include <bits/c++config.h>
#include <bits/functexcept.h>
#include <ctime>