This is the mail archive of the
mailing list for the GCC project.
Re: making sizeof(void*) different from sizeof(void(*)())
- From: "Paulo J. Matos" <paulo at matos-sorge dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 02 May 2012 14:08:13 +0100
- Subject: Re: making sizeof(void*) different from sizeof(void(*)())
- References: <CAPOJ94PbYfsHkPGQ2U02vpAiyMDP7Ksr4OajpGHeS35-iWijeQ@mail.gmail.com> <firstname.lastname@example.org> <4F9E605F.email@example.com> <CAPOJ94O8pcva=WrADoz1+CW3FnAaWT6tE6PchB9koq9BZuSfirstname.lastname@example.org>
On 30/04/12 13:01, Peter Bigot wrote:
I would like to see the technical details, if your code is released somewhere.
Sorry for the delay.
The code is not released, however I can send you a patch against GCC
4.6.3 sources (our GCC 4.7.0 port is not yet stable) of our changes and
will also try to explain how it works.
Without having started it yet, I'm thinking this can be done by
modifying build_pointer_type to generalize the
TARGET_ADDR_SPACE_POINTER_MODE to TARGET_TYPE_POINTER_MODE, pass it
the whole type instead of just the address space field, and moving
TARGET_ADDR_SPACE_POINTER_MODE support to the default implementation
for that hook. Likewise for build_reference_type. Then judicious
application of attributes to types and decls would allow detection of
the situation where a non-standard pointer size is needed. I'm hoping
there aren't too many other places where that work would get undone.
As you will see, I haven't used anything related to address spaces
feature in GCC.
Sounds like a useful set of changes to have in the main sources, since
this is hardly a singular need!
Yes. Is there an existing bug/enhancement report for this capability?
Don't think so but I would be happy to contribute with whatever I can.