This is the mail archive of the gcc@gcc.gnu.org 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: does gcc support multiple sizes, or not?


DJ Delorie wrote:
>> And back to my original answer: it's up to each language to decide
>> that.
> 
> Hence my original question: is it legal or not?  What did the C++
> developers decide?

The C++ standard implies that for all pointer-to-object types have the
same size and that all pointer-to-function types have the same size.
(Technically, it doesn't say that that; it says that you can convert T*
-> U* -> T* and get the original value.)  However, nothing in the
standard says that pointer-to-object types must have the same size as
pointer-to-function types.

In theory, I believe that G++ should permit the sizes to be different.
However, as far as I know, none of the G++ developers considered that
possibility, which probably means that we have made the assumption that
they are all the same size at some points.  I would consider places
where that assumption is made to be bugs in the front end.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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