LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   gcc 4.1 vs 4.3 source code compatibility (https://www.linuxquestions.org/questions/programming-9/gcc-4-1-vs-4-3-source-code-compatibility-653580/)

mistretzu 07-04-2008 09:42 AM

gcc 4.1 vs 4.3 source code compatibility
 
I have some source code that was compiling well with gcc 4.1, recently I moved to openSuse that has gcc 4.3.1 and the same code fails to compile using this version of compiler.
Generally it complains that it doesn't recognize functions like malloc or wtol. I can easily fix this by including appropriate headers like stdlib.h or what ever is necessary.

But it is important not to change the source code at all. Is it possible to make them compile using 4.3.1? Is there some flag that I can specify to the compiler?
Or do I need to uninstall 4.3.1 and install 4.1?

Thanks.

dmail 07-04-2008 03:27 PM

You can temporally set the gcc version like so
Quote:

CC=gcc-4.1 make


All times are GMT -5. The time now is 06:50 PM.