This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: assumes sizeof(size_t) == sizeof(void *)

On November 8, 2014 9:00:02 AM CST, Jonathan Wakely <> wrote:
>On 7 November 2014 16:56, Joel Sherrill wrote:
>> On 11/7/2014 9:25 AM, Paolo Carlini wrote:
>>> Hi,
>>> On 11/07/2014 04:07 PM, Joel Sherrill wrote:
>>>> Hi
>>>> 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, but
>>> 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
>to get
>> the type definition by including <cstdint> but it didn't compile.
>Did you try std::uintptr_t?

Yes. The only surprise was needing to include stdint.h instead of cstdint to get uintptr_t.

It built m32c-rtems and then I left a native Linux bootstrap and make check running. I will post the test results and patch Monday. Hopefully that is an OK solution.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]