make check-target-libstdc++-v3 fails because ptrdiff_t is undefined. std::ptrdiff_t works. Maybe this bug is related to the Linux system run on. I have openSuse 11.1 running. configure --enable-languages=c,c++ --program-suffix=-rep --prefix=$HOME/gcc/install_trunk_1 In file included from /home/singler/gcc/trunk_1/libstdc++-v3/testsuite/util/testsuite_abi.h:27:0, from /home/singler/gcc/trunk_1/libstdc++-v3/testsuite/util/testsuite_abi.cc:23: /home/singler/gcc/trunk_1/libstdc++-v3/libsupc++/cxxabi.h:371:5: error: 'ptrdiff_t' does not name a type /home/singler/gcc/trunk_1/libstdc++-v3/libsupc++/cxxabi.h:447:23: error: 'ptrdiff_t' has not been declared /home/singler/gcc/trunk_1/libstdc++-v3/libsupc++/cxxabi.h:459:18: error: 'ptrdiff_t' has not been declared /home/singler/gcc/trunk_1/libstdc++-v3/libsupc++/cxxabi.h:469:26: error: 'ptrdiff_t' has not been declared /home/singler/gcc/trunk_1/libstdc++-v3/libsupc++/cxxabi.h:495:18: error: 'ptrdiff_t' has not been declared /home/singler/gcc/trunk_1/libstdc++-v3/libsupc++/cxxabi.h:501:26: error: 'ptrdiff_t' has not been declared /home/singler/gcc/trunk_1/libstdc++-v3/libsupc++/cxxabi.h:540:18: error: 'ptrdiff_t' has not been declared /home/singler/gcc/trunk_1/libstdc++-v3/libsupc++/cxxabi.h:546:26: error: 'ptrdiff_t' has not been declared /home/singler/gcc/trunk_1/libstdc++-v3/libsupc++/cxxabi.h:566:4: error: 'ptrdiff_t' has not been declared compiler exited with status 1 Any ideas and/or a workaround?
I can't reproduce this. I booted and tested many times on various linux systems and HJ already reported many succesfull testresults since. Please remove everything from the build dir, gave everything fresh and retry.
I had cleaned the builddir already. Adding #include <cstddef> solves the problem. The crucial file seems to be lib/gcc/x86_64-unknown-linux-gnu/4.6.0/include/stddef.h Only if it is (indirectly) included, ptrdiff_t is defined in the global scope. Maybe on other systems, ptrdiff_t is also declared somewhere else, so the problem does not appear.
*** Bug 44416 has been marked as a duplicate of this bug. ***
To be clear: does a normal 'make check' (either from the root of the build dir or from inside the library build dir) work? Because it works here and fo everybody else on the testresult mailing list, also for people using your exact same linux.
Hey, 44416 is *not* a duplicate! Please re-open it immediately.
Note that cxxabi.h already includes <stddef.h> and at that line 371 uses ptrdiff_t unqualified, thus everything is fine. I suspect you simply forgot to update your compiler, because the current library does not work without a recent front end fix applied by Jason.
Closing.
I can't help it, "make check" in the libstdc++-v3 directory still does not work for me, even after reconfiguring and recompiling everything from scratch, using vanilla rev 160275. Let's have a look at attached testsuite_abi.ii. The first typedef for std::ptrdiff_t is in line 49, but the first typedef for ptrdiff_t in the global scope is only in line 30203. The first error is in line 24823, however, this is in (sub?) namespace __cxxabiv1. Should this work anyway? I'm quite lost.
Created attachment 20845 [details] Failing test case.
Something is broken in your system, I also tested on an Open Suse 11.1, to be sure, and everything works fine. Remove everything, fetch again the entire gcc mainline and try again.
Obviously, I'm not the only one having this problem, Jason has patched libstdc++-v3/testsuite/util/testsuite_abi.h in the meantime. ------------------------------------------------------------------------ r160313 | jason | 2010-06-05 15:13:46 +0200 (Sat, 05 Jun 2010) | 1 line * testsuite/util/testsuite_abi.h: Work around glibc BZ 9694. +// Include stddef now to work around glibc BZ 9694 +#include <stddef.h> related to <http://sourceware.org/bugzilla/show_bug.cgi?id=9694> This solves the problem testsuite_abi.h, but then, the next test fails, namely testsuite_allocator.h. I have tested all that using a different user ID, with a completely clean environment and new checkout, but the problem persists.
Yes, it's a glibc bug (I don't have available any machine using that old glibc), and if you look at the mailing list, I already commented that could be related to your issue. I think we should use the same workaround for that other testsuite header and closw this sucker. Any patch along these lines is pre-approved, in any case I would not be able to test it.
As a matter of fact, in testsuite_allocator.h the problem can be solved much more cleanly by simply qualifying with std:: the size_t and ptrdiff_t in tge second half of the file, I can do that later today.
Created attachment 20855 [details] Tentative patch (only sanity checked on a system not affected by the glibc issue)
Johannes, can you try the patch and in case, give me some details about the remaining issues? The idea is simply that if a glibc header has been included by <cwctype> before <wctype.h>, then __GLIBC__ is defined and __GLIBC_MINOR__ set to the proper value. If the minor is < 10, thus <wctype.h> is buggy, we include by hand <stddef.h> *before* <wctype.h>. It should work. Unless the library is somehow including <wctype.h> somewhere else outside <cwctype>. That should be also fixed.
Errata: "... by <cwctype> before <wctype.h>..." should read "... before <cwctype> wants to include <wctype.h>..."
Subject: Bug 44417 Author: paolo Date: Tue Jun 8 01:46:10 2010 New Revision: 160417 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160417 Log: 2010-06-07 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/44417 * include/c_std/cwctype: Provide a workaround for bug glibc BZ 9694 affecting glibc 2.9 and older. * include/c_global/cwctype: Likewise. * testsuite/util/testsuite_abi.h: Remove temporary workaround. * testsuite/util/testsuite_allocator.h: Use everywhere std::size_t and std::ptrdiff_t, don't include <cstddef>. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ error_code.cc: Minor tweak, prefer <cwchar> to <wchar.h>. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/c_global/cwctype trunk/libstdc++-v3/include/c_std/cwctype trunk/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/error_code.cc trunk/libstdc++-v3/testsuite/util/testsuite_abi.h trunk/libstdc++-v3/testsuite/util/testsuite_allocator.h
Fixed.
Yes.