Bug: size_t instead of std::size_t in <cstddef>

Gabriel Dos Reis Gabriel.Dos-Reis@cmla.ens-cachan.fr
Sat Apr 1 00:00:00 GMT 2000


Hi Nico,

Nicolai Josuttis <nicolai.josuttis@braunschweig.netsurf.de> writes:

| If I use <cstddef> of libstdc++-2.90.7
| size_t (and probably ptrdiff_t) is
| defined in the global namespace.

Yes.  This is a known problem as we didn't (yet) put the C-headers
<cxxx> in namespace std.  We need help from the compiler as described
in docs/17_intro/TODO: 

   - scoping/linking issues WRT to C structs need to be worked out. See
     Nathan's commentary on cantrip, http://www.cantrip.org/cheaders.html

[...]

| However, looking into source code I see some
| stuff inside shadow/stddef.h that seems to handle
| this issue in a way that's not obvious for me.
| If I insert /shadow into my include search path
| it works fine.

The basic approach is described in Nathan's paper.

| BUT, if I include <cstdlib> then
| I get the following error (and more):
| > /local/gcc/H-libstdc++/include/g++-v3/shadow/bits/std_cstdlib.h: In function `struct std::div_t std::div(int, int)':
| > /local/gcc/H-libstdc++/include/g++-v3/shadow/bits/std_cstdlib.h:187: `_div_t' undeclared (first use this function)

Odd.  I'll look into this stuff, this night.

-- Gaby


More information about the Libstdc++ mailing list