I have to compile old style K&R C code on a SuSE Linux 8.0.
But when I try to use the installed gcc 3.0 it tells me to use another
compiler that can still handle old style code. I've read that there was a
break in the gcc development and they don't support this kind of code
anymore.
Now my question: What do I have to do to compile this old code? Shall I use
another compiler? Includes? Libraries?
Impacts?
Cheers
Markus
> I have to compile old style K&R C code on a SuSE Linux 8.0.
> But when I try to use the installed gcc 3.0 it tells me to use another
> compiler that can still handle old style code.
What command line did you use?
> I've read that there was a
> break in the gcc development and they don't support this kind of code
> anymore.
>
> Now my question: What do I have to do to compile this old code? Shall I use
> another compiler? Includes? Libraries?
I just tried compiling this K&R C code
--- cut here ---
main(argc, argv)
int argc;
char *argv[];
{
return 0;
}
--- cut here ---
with gcc-2.95 and 3.0, and both compiled it without any complaints.
Cheers,
> What command line did you use?
>
I use following line:
cc -c -m486 -traditional -traditional-cpp -D_POSIX_SOURCE -D_BSD_SOURCE
-DALIS_AG -fno-strict-prototype -fsigned-char -DLINUX -DLINUX -DSYS=SYS5
-DNO_APX_INTERNATIONAL=1 -I/port/rev2.2/pgms/includes
-I/port/rev2.2/pgms/amake -I/port/rev2.2/pgms/amake/../prox_6.0 -DFOR_AMAKE
/port/rev2.2/pgms/amake/am_main.c
After removing both traditional flags it went on but stopped in:
#if 0
some text
#endif
telling me the line is not terminated.
Do you know the cpp option to show only the cpp output. I'm not sure but I
think it's only a pre-processor problem.
Cheers
Use '-E' instead of '-c' and you should see the pre-processor output.
Regards,
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]