My 0.02$CURRENCY:

> > I've done a google search on "initializer element not constant" and
> > found it covers a whole lot of cases, and in a fair number of those it
> > is a program maintenance issue, as gcc doesn't tolerate it any longer.

Yes. I believe the C standard never specified that that kind of 
historic use was legal, but all compilers in the past were implemented
such that the construct was accepted. The problem with that is that it
doesn't allow for a lot of compiler-optimisations, or changing the way
in which internal thigns are defined, so newer compilers explicitly
disallow the construct. You will have noticed that gcc 3 generates much
faster code than gcc 2.

The solution is to not use an initialised variable. Instead of

        FILE *var = something;

use

        FILE *var;
        var = something;


On the bigger picture, I wouldn't bother with fixing code which was
abandoned years ago, when equivalent well-maintained and functional
solutions exist already.

Volker

-- 
Volker Kuhlmann                 is list0570 with the domain in header
http://volker.dnsalias.net/     Please do not CC list postings to me.

Reply via email to