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: pointer math vs named address spaces


On Wed, 3 Dec 2014, DJ Delorie wrote:

> > However, pointer subtraction still returns ptrdiff_t, and sizeof still 
> > returns size_t,
> 
> Why?

Well, TR 18037 doesn't do anything to change that, so if you define some 
target-specific way to use different types in certain circumstances then 
you're going outside what was allowed for in the TR.  In the case of 
sizeof there's also the issue the same type being used for objects in 
different address spaces - how do you determine when sizeof (which can be 
a runtime operation when VLAs are involved) should return some different 
type because of address space involvement, or what type to use to store a 
VLA size at runtime?

-- 
Joseph S. Myers
joseph@codesourcery.com


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