httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: [PATCH] Config File Line Continuation (take 3)
Date Tue, 03 Mar 1998 14:38:28 GMT
Ben Hyde wrote:
> 
> This was discussed at great length in december (nh9712).  I thought I
> recalled that
> the MS c compiler complains about some of these constructs as a
> consequence of
> it's interest in segmented memory architectures, but that's not
> mentioned in the
> discussion.  So party down.

That's right... That's why the condition that the data actually
exists. If, for example, you move cp down a few notches, you
can then use backwards references to it since you know that the
data is all in the same segment. So the below is legal:

    char *cp;
    ...
    cp = &array[0];
    ...
    cp++;
    ...
    cp++;
    ...
    c = cp[-1];

> 
> On Monday, March 02, 1998 8:05 PM, Jim Jagielski [SMTP:jim@jaguNET.com]
> wrote:
> > Rodent of Unusual Size wrote:
> > > 
> > > That is, I prefer "cp[-1]" to "*(cp - 1)".  Ben, is a negative index
> > > guaranteed safe for C arrays?
> > > 
> > 
> > Only if it's known and guaranteed that the data refered to actually
> > exists.
> > 
> > -- 
> > ====================================================================
> >       Jim Jagielski            |       jaguNET Access Services
> >      jim@jaguNET.com           |       http://www.jaguNET.com/
> >             "Look at me! I'm wearing a cardboard belt!"
> > 
> > 
> 


-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
            "Look at me! I'm wearing a cardboard belt!"

Mime
View raw message