> > 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