Making legacy code const correct

Mika Heiskanen Mika.Heiskanen@fmi.fi
Mon Oct 20 16:10:00 GMT 2003


Hi,

Given that g++ is able to check that a const method uses a non-const 
method or modifies the class variables directly, shouldn't it also
be able to detect when a non-const method really is const correct?
A compiler flag to enable such checks would be most useful when
converting large amounts of legacy code to be const correct. Unfortunately 
I myself am not at all familiar with the gcc code base, anyone more
knowledgeable out there who'd be interested in implementing this
new feature?

--> Mika.Heiskanen@fmi.fi
    Finnish Meteorological Institute





More information about the Gcc mailing list