This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: pointer math vs named address spaces
- From: Joseph Myers <joseph at codesourcery dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Thu, 4 Dec 2014 00:33:01 +0000
- Subject: Re: pointer math vs named address spaces
- Authentication-results: sourceware.org; auth=none
- References: <201412032234 dot sB3MYEmp030041 at greed dot delorie dot com> <alpine dot DEB dot 2 dot 10 dot 1412032239220 dot 26828 at digraph dot polyomino dot org dot uk> <201412032252 dot sB3Mqdji004665 at greed dot delorie dot com>
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