Will code written under the C++98 standard work with newer compilers, such as g++. Or will it not work. Assumedly simple “Hello World” programs would work, but how about complicated command line programs?
Will code written under the C++98 standard work with newer compilers, such as g++.
Share
The
-std=command line argument tog++allows you to compile against a specific version of the standard.See: http://linux.die.net/man/1/g++
If in the future the authors of g++ (this applies to any compiler I suppose) decide to default to an incompatible version of the standard, this argument would let you compile older code.
It should only stop working if the authors of g++ drop C++98 support entirely. I see this happening only when the amount of C++98 code becomes so small or the new standards so incompatible with it that it’s easier to have people update all their code than to keep supporting it. In any case, it should be a gradual and foreseeable change.