From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <8edba5d726ee6a032d8521c7de33f499@felloff.net> Date: Tue, 5 Jan 2016 10:28:14 +0000 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a1143ab92fd8316052893b1a3 Subject: Re: [9fans] subtracting pointers on amd64 6c Topicbox-Message-UUID: 7e3ec032-ead9-11e9-9d60-3106f5b1d025 --001a1143ab92fd8316052893b1a3 Content-Type: text/plain; charset=UTF-8 On 5 January 2016 at 10:15, Charles Forsyth wrote: > 2) if a pointer subtraction has to yield a long, why dont we cast *after* >> the division? >> > > that would be certainly be better. > since 6c is more commonly used now, and there's more interest or need, it's probably best just to introduce the difference type and change the result type. it's the same thing with usize. i'll see if i can add some code to check for mismatches automatically. there are usable ANSI formats for the difference and sizeof types. --001a1143ab92fd8316052893b1a3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 5 January 2016 at 10:15, Charles Forsyth <charles.forsyth@gma= il.com> wrote:
2) if a= pointer subtraction has to yield a long, why dont we cast *after* the divi= sion?

=C2=A0that would be = certainly be better.

since 6c is more commonly = used now, and there's more interest or need, it's probably best jus= t to introduce
the difference type and chan= ge the result type. it's the same thing with usize.
i'll see if i can add some code to check for mismatches au= tomatically.

there are usable ANSI formats for the difference and sizeof types.


--001a1143ab92fd8316052893b1a3--