Compiling older code with gcc/g++

I have some older cpp code that was written when gcc 2.95 was in general use, but this code does not compile under g++ 4.x or even 3.3.

Is there a way to tell the compiler to compile code that is old and not written to present standards? I seem to recall there is a way to do it but I do not recall specifics. Even if I had the programming skill to do it, the code says that it is forbidden to modify the code without permission from the company that developed it. They provided the code but do not allow it to be modified (it is for a game).

thanks
 

mgb_phys

Science Advisor
Homework Helper
7,660
11
If it was written to c++ standards at the time it should still work. Presumably it included some g++ non-standard additions that have been dropped - can you post specific examples?
 
403
1
I have some older cpp code that was written when gcc 2.95 was in general use, but this code does not compile under g++ 4.x or even 3.3.

Is there a way to tell the compiler to compile code that is old and not written to present standards?
...
Not really.
Maybe it uses "varargs" instead "stdarg" (the standard). The best thing to do is to install gcc 2.95 , etc...
 
Not really.
Maybe it uses "varargs" instead "stdarg" (the standard). The best thing to do is to install gcc 2.95 , etc...
Thanks, I think that might be the easiest thing to do. I could not post the problem code here because it is proprietary.
 

The Physics Forums Way

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top