httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David D'Antonio" <>
Subject Re: [Fwd: Problem 2534]
Date Mon, 03 Aug 1998 23:11:35 GMT

-----Original Message-----
From: Alexei Kosut <akosut@leland.Stanford.EDU>
To: <>
Date: Monday, August 03, 1998 6:51 PM
Subject: Re: [Fwd: Problem 2534]


>Waitaminute. If this was *foo and *bar, then I could buy this; it makes
>sense. But foo[] and bar[] are supposed to allocate arrays on the stack
>(six bytes each), and are supposedly writeable. Any compiler that makes
>foo == bar is severely wrong, IMHO. Unless you're allowing your optimizing
>compiler to play with your stack arrangement, and it should only do that
>in this case if it's absofragginglutely sure you're not modifying either
>foo or bar. Which isn't a case covered by the ANSI/ISO spec.
>(Recall that arrays and pointers are not the same thing in C, no matter
>how alike they may act)

Its been a while and things might have changed, but I always thought that
(single dimensional) arrays and pointers *are* the same thing in C, which
is why they act the same. the square brackets are an operator which does
pointer math and de-references the result.

So foo == bar is valid thing to test for, even if foo and bar are single
arrays. I've been told it works differently at higher dimensions, but I don't
know for

Of course, ANSI C may have changed all this and its not necessaryily a cool
to do anyway but hey...


>-- Alexei Kosut <> <>
>   Stanford University, Class of 2001 * Apache <> *


View raw message