[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#225935: gcc-3.3: function static variable initialization allowed with pure functions only when -O is used



> > It can only do that because it knows strlen is pure, thats the point
> > of pureness.
>
> That alone wouldn't suffice, the value has to be known at compile
> time.
>
> > If the standard says constant only, gcc should choke on strlen()
> > with or without optimization.
>
> Correct. Currently, it doesn't, which is what PR456 is about.

Ok, but currently my particular bug doesn't happen for functions that
aren't pure, as my example showed.

> > > I suggest we either mark this as forwarded pointing to above bug, or
> > > close it, since it is IMHO a pretty minor issue...

If you're sure that bug represents my problem, I guess merging it is the
thing to do.

Britton




Reply to: