This is the mail archive of the
mailing list for the GCC project.
Re: mt_allocator.cc assumes sizeof(size_t) == sizeof(void *)
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: Paolo Carlini <paolo dot carlini at oracle dot com>,GCC Mailing List <gcc at gcc dot gnu dot org>,DJ Delorie <dj at redhat dot com>,libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Sat, 8 Nov 2014 09:30:18 -0600
- Subject: Re: mt_allocator.cc assumes sizeof(size_t) == sizeof(void *)
- Authentication-results: sourceware.org; auth=none
- References: <545CE038 dot 5000403 at oarcorp dot com> <545CE454 dot 1000201 at oracle dot com> <545CF9D3 dot 4090404 at oarcorp dot com> <CAH6eHdSPH73OKc7tuDN+tVWS9vkEqmyFVH-NbOy-ZfOnHPn7=A at mail dot gmail dot com> <CE9C431B-D29F-4B7A-A558-56C60680D369 at oarcorp dot com>
On November 8, 2014 9:04:14 AM CST, Joel Sherrill <firstname.lastname@example.org> wrote:
>On November 8, 2014 9:00:02 AM CST, Jonathan Wakely
>>On 7 November 2014 16:56, Joel Sherrill wrote:
>>> On 11/7/2014 9:25 AM, Paolo Carlini wrote:
>>>> On 11/07/2014 04:07 PM, Joel Sherrill wrote:
>>>>> On m32c-rtems, we have a build error in C++ because size_t
>>>>> is 16-bits and pointers are 24 bits. m32c-elf probably does not
>>>>> enable __GTHREAD support like rtems does. Since this is code
>>>>> shared across targets, what is the best way to fix this?
>>>> I don't know the exact opinion of the other library maintainers,
>>>> personally I consider mt_allocator an old experiment, which,
>>>> to make any sense today would need profound changes. In particular,
>>>> don't think we can hope to get something useful from it when size_t
>>>> 16 bits and, more importantly, pointers are 24 bits. Thus, my
>>>> recommendation would be just arranging for its code not to break
>>>> bootstrap, nothing more than that.
>>> OK. I am building now with the size_t changed to uintptr_t. I tried
>>> the type definition by including <cstdint> but it didn't compile.
>>Did you try std::uintptr_t?
>Doh!! You meant putting std:: in front and using cstdint. No. I will
This didn't compile. Ended with an error about requiring C++11 in a header file. This code is in a c++98 subdirectory so it dues make sense. I can't cut and paste it at home.
>Sorry for missing the point.