This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Size of basic types
- From: Paul Schlie <schlie at comcast dot net>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Fri, 03 Dec 2004 22:24:19 -0500
- Subject: Re: Size of basic types
> From: Zack Weinberg <zack@codesourcery.com>
>> Paul Schlie wrote:
>>> Zack Weinberg writes:
>>>> Jean-Eric Cuendet <jec@rptec.ch> writes:
>>>> Hi,
>>>> I work under 64 bits Linux on AMD64 and GCC 3.4
>>>> I have:
>>>> int => 32
>>>> long => 64
>>>> long long => 64
>>>> void* => 64
>>>>
>>>> Is it possible to have:
>>>> int => 32
>>>> long => 32
>>>> long long => 64
>>>> void* => 64
>>>
>>> No. This will never be supported
>>
>> Do you mean GCC can't support the desired type size specification
>> for some reason; or that it's not consistent Linux's 64-bit
>> kernel/library API type size requirements/assumptions?
>
> I mean primarily that it's not consistent with the amd64-linux
> platform ABI and therefore would require a hell of a lot of work to
> implement (you'd need e.g. a new C library port) which I do not think
> is worth doing.
>
> Secondarily, I consider it an important property of C-as-she-is-spoke
> that sizeof(void*) <= sizeof(long), and I do not think GCC should ever
> facilitate breaking that property.
>
> zw
Thanks, I didn't appreciate that there was a dependency between the size of
a pointer and the size of a long; I had mistakenly presumed that as long as
there was a supported int datatype which was at least as large as a pointer
(as in the above example long long == pointer size) GCC's infrastructure
would support it.