Compiling older code with gcc/g++

  • Thread starter Thread starter Pollywoggy
  • Start date Start date
  • Tags Tags
    Code
Click For Summary

Discussion Overview

The discussion revolves around the challenges of compiling older C++ code originally written for gcc 2.95 with newer versions of g++. Participants explore potential solutions and the implications of using outdated code standards.

Discussion Character

  • Technical explanation, Debate/contested

Main Points Raised

  • One participant notes that the older code does not compile under g++ 4.x or 3.3 and seeks a way to compile it without modifying the code due to company restrictions.
  • Another participant suggests that if the code adhered to C++ standards of its time, it should still compile, but questions whether it includes non-standard additions that may have been dropped in newer versions.
  • A different participant proposes that the code might be using "varargs" instead of the standard "stdarg," indicating a potential source of compilation issues.
  • There is a suggestion that the simplest solution may be to install gcc 2.95 to compile the code as intended.

Areas of Agreement / Disagreement

Participants express differing views on whether the code should compile under newer standards, with some suggesting it may have non-standard elements, while others propose reverting to the original compiler as a solution. The discussion does not reach a consensus on the best approach.

Contextual Notes

Participants acknowledge the proprietary nature of the code, which limits the ability to share specific examples or details about the compilation errors encountered.

Pollywoggy
Messages
53
Reaction score
0
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
 
Technology news on Phys.org
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?
 
Pollywoggy said:
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...
 
Rogerio said:
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.
 

Similar threads

Replies
6
Views
3K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 27 ·
Replies
27
Views
6K
  • · Replies 30 ·
2
Replies
30
Views
7K
  • · Replies 16 ·
Replies
16
Views
9K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
9K