Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compile old K&R C code on SuSE Linux 8.0 using gcc 3.0 ?

162 views
Skip to first unread message

Markus Wegmann

unread,
May 25, 2002, 1:13:02 PM5/25/02
to
Hi

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

Paul Pluzhnikov

unread,
May 25, 2002, 8:24:51 PM5/25/02
to
Markus Wegmann <we...@swissonline.ch> writes:

> 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,

Markus Wegmann

unread,
May 26, 2002, 12:39:49 PM5/26/02
to
Paul Pluzhnikov wrote:


> 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

Richard Dawe

unread,
May 26, 2002, 1:59:40 PM5/26/02
to
Markus Wegmann wrote:
[snip]

> 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.

Use '-E' instead of '-c' and you should see the pre-processor output.

Regards,

--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

0 new messages