Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Questions about pointer comparisons
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Keith Thompson  
View profile  
 More options Dec 1 2009, 8:03 pm
Newsgroups: comp.lang.c
From: Keith Thompson <ks...@mib.org>
Date: Tue, 01 Dec 2009 17:03:45 -0800
Local: Tues, Dec 1 2009 8:03 pm
Subject: Re: Questions about pointer comparisons

Kaz Kylheku <kkylh...@gmail.com> writes:
> On 2009-12-01, Keith Thompson <ks...@mib.org> wrote:
>> If the language required "<" and ">" to work consistently for pointer
>> values (i.e., for any two valid pointers p1 and p2, exactly one of
>> (p1 < p2), (p1 == p2), and (p1 > p2) is true, along with the other
>> usual consistency requirements), then the "<" and ">" operators
>> *would* have to do all that work.

> Which means that code targetting 8086 machines would be larger and slower,
> having to normalize segment:offset values rather than blindly comparing
> them as 32 bit words.

> When C was standarized, this architecture was widespread, and used
> as a target for C programming. Standardizing pointer inequality would have
> codified code that didn't work on MS-DOS, at least in some memory models.

> This issue is now worth revisiting.

Agreed (except that I think you meant relational operators, not
inequality).

--
Keith Thompson (The_Other_Keith) ks...@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.