Re: replacing INTVAL in memory and register

2001-10-04 Thread Bryan C . Warnock
On Thursday 04 October 2001 11:22 am, Dan Sugalski wrote: > At 11:16 AM 10/4/2001 -0400, Bryan C. Warnock wrote: > >Since pointers and integers are now considered incommensurate, the only > >integer that can be safely converted to a pointer is the constant 0. > > The result of converting any oth

Re: replacing INTVAL in memory and register

2001-10-04 Thread Dan Sugalski
At 11:16 AM 10/4/2001 -0400, Bryan C. Warnock wrote: >Since pointers and integers are now considered incommensurate, the only >integer that can be safely converted to a pointer is the constant 0. The >result of converting any other integer to a pointer is machine dependent. Since the only place

Re: replacing INTVAL in memory and register

2001-10-04 Thread Dan Sugalski
At 07:16 PM 10/4/2001 +0400, Timur Safin wrote: >ptrdiff_t > Signed integral type of the result of subtracting two pointers. Ah, signed. Forgot about that. size_t would be better, then. Absolute addresses are unsigned. Dan ---

Re: replacing INTVAL in memory and register

2001-10-04 Thread Bryan C . Warnock
On Thursday 04 October 2001 11:08 am, Bryan C. Warnock wrote: > In C9x, pointer-integer conversions (except for 0) aren't guaranteed for > doing pointer arithmetic. (There was a good explanation that I ran across > the other day, but I can't seem to find it now.) Found it. The ANSI rationale

Re: replacing INTVAL in memory and register

2001-10-04 Thread Timur Safin
tgibbs" <[EMAIL PROTECTED]> To: "'Bryan C. Warnock '" <[EMAIL PROTECTED]>; "Gibbs Tanton - tgibbs" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, October 04, 2001 6:48 PM Subject: RE: replacing INTVAL in memory and register :

Re: replacing INTVAL in memory and register

2001-10-04 Thread Bryan C . Warnock
On Thursday 04 October 2001 10:48 am, Gibbs Tanton - tgibbs wrote: > My ANSI and ISO Standard C reference manual (Plauger and Brodie) has it > listed in with the comment: > > ptrdiff_t( which is the type of the subtract operator when its operands > are both pointers to data objects ). > > Althoug

RE: replacing INTVAL in memory and register

2001-10-04 Thread Gibbs Tanton - tgibbs
-Original Message- From: Bryan C. Warnock To: Gibbs Tanton - tgibbs; '[EMAIL PROTECTED]' Sent: 10/4/2001 9:41 AM Subject: Re: replacing INTVAL in memory and register On Thursday 04 October 2001 10:38 am, Gibbs Tanton - tgibbs wrote: > INTVAL is used in memory and register to cast a

Re: replacing INTVAL in memory and register

2001-10-04 Thread Bryan C . Warnock
On Thursday 04 October 2001 10:38 am, Gibbs Tanton - tgibbs wrote: > INTVAL is used in memory and register to cast a pointer to an integer for > mathematical operators. Instead of using INTVAL I propose we use > ptrdiff_t or size_t (with my preference being the former). It would not > be used an

Re: replacing INTVAL in memory and register

2001-10-04 Thread Dan Sugalski
At 09:38 AM 10/4/2001 -0500, Gibbs Tanton - tgibbs wrote: >INTVAL is used in memory and register to cast a pointer to an integer for >mathematical operators. Instead of using INTVAL I propose we use ptrdiff_t >or size_t (with my preference being the former). Is ptrdiff_t a base type that crept i

replacing INTVAL in memory and register

2001-10-04 Thread Gibbs Tanton - tgibbs
INTVAL is used in memory and register to cast a pointer to an integer for mathematical operators. Instead of using INTVAL I propose we use ptrdiff_t or size_t (with my preference being the former). It would not be used anywhere else, just when we need to do mathematics on pointers. Both are giv