httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@worldgate.com>
Subject Re: [Fwd: Problem 2534]
Date Mon, 03 Aug 1998 18:11:19 GMT
On Mon, 3 Aug 1998, Rodent of Unusual Size wrote:

> Dirk-Willem van Gulik wrote:
> > 
> > I believe that according to the ANSI standard (page 91)
> > if I read it correctly a compiler _may_
> > 
> >         char foo[] = "hello";
> >         char some[] = "one";
> >         char bar[] = "hello";
> > 
> > end up having foo == bar. Or even if you are unlucky
> > 
> >         char foo[] = "hello world";
> >         char bar[] = "world";
> > 
> > can lead to foo+6 == bar.
> 
> Oh sigh.  Hmm.  If this is due to string constant folding, does
> changing the compiler optimisation have any effect?

This is not due to that unless there is a bug in the code.

The only thing that should be happening is multiple char *s get set to the
same constant string and get passed around for a while before being
compared.


Mime
View raw message