Path: utzoo!attcan!uunet!ncrlnk!ncrcae!ece-csc!ncsuvx!gatech!ncar!tank!uxc!uwmcsd1!leah!itsgw!imagine!rpics!kyriazis
From: kyriazis@rpics (George Kyriazis)
Newsgroups: comp.lang.c
Subject: Re: array[-1] -- permitted?
Message-ID: <1237@imagine.PAWL.RPI.EDU>
Date: 22 Sep 88 06:42:13 GMT
References: <867@osupyr.mast.ohio-state.edu> <3200@geac.UUCP> <1430@ficc.uu.net> <1988Sep19.164701.11136@ateng.uucp> <2583@ingr.UUCP>
Sender: news@imagine.PAWL.RPI.EDU
Reply-To: kyriazis@turing.cs.rpi.edu (George Kyriazis)
Organization: RPI CS Dept.
Lines: 34

In article <2583@ingr.UUCP> jones@ingr.UUCP (Mark Jones) writes:
>In article <1988Sep19.164701.11136@ateng.uucp>, chip@ateng.uucp (Chip Salzenberg) writes:
>> According to news@ism780c.isc.com:
>> >But consider what might have happened had dpANS mandated that the compution
>> >of a pointer to x[-1] be a valid operation.
>> 
>> Okay, let's imagine:  X3J11 says that x[-1] must be valid.
>> 	       then:  int must be 32 bits.
>
>Excuse my ignorance, but why must an int be 32 bits for the above to work?
>
>> 	       then:  address space must be linear.
>
>Does X3J11 say that the contents of x[-1] must be valid?
>
>Mark Jones


Excuse for the question, but that is the first time I am looking at that
subject and I don't see any reason why x[-a] can't be permitted, mainly
for two basic reasons:
    (a)	x[a] == *(x+a)  therefore  x[-1] == *(x-1), which looks
	perfectly ok to me.

    (b)	yacc uses array[-1].  If it is considered invalid, that will mean
	that yacc has to be rewriten for the new standard?

Am I missing something?



  George Kyriazis
  kyriazis@turing.cs.rpi.edu
------------------------------