gcc compiler options for K&R C code Options

U

Utkado

Hi,

Escuse me for posting this compiler specific query in this newsgroup.
I have already posted it in the gnu.gcc.help group but not received
any response hence posting this this query here in case someone can
provide the right information.

We are currently using a legacy application on solaris which contains
K&R style C code and needs to be migrated to linux platform.

My query is does gcc compiler support K&R C code ? If so what are
the
compiler options to be specifically provided for to gcc to compile
successfully ?


Thanks
Utkado
 
K

Keith Thompson

Utkado said:
Escuse me for posting this compiler specific query in this newsgroup.
I have already posted it in the gnu.gcc.help group but not received
any response hence posting this this query here in case someone can
provide the right information.

We are currently using a legacy application on solaris which contains
K&R style C code and needs to be migrated to linux platform.

My query is does gcc compiler support K&R C code ? If so what are
the
compiler options to be specifically provided for to gcc to compile
successfully ?

Much K&R code is still valid C90 or C99 code. For example, old-style
function declarations are still supported, and implicit int is still
valid in C90 (though not in C99). You might find that your code will
compile with the default settings.

gcc comes with extensive documentation. Try "info gcc" and search for
"K&R" ('s' to search, 'n' to find the next occurrence).
 
N

nicolas.sitbon

Hi,

Escuse me for posting this compiler specific query in this newsgroup.
I have already posted it in the gnu.gcc.help group but not received
any response hence posting this this query here in case someone can
provide the right information.

We are currently using a legacy application on solaris which contains
K&R style C code and needs to be migrated to linux platform.

My query is does gcc compiler support K&R C code  ? If so what are
the
compiler options to be specifically provided for to gcc to compile
successfully ?

Thanks
Utkado

try with -traditional.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

GCC/K&R Incompatibility 16
K&R 1-24 15
ANSI -> K&R ? 19
"K&R" C 16
Problematic code in K&R 1
Which lean C compiler for 32-bit OS development 92
K&R Ex 1-3 33
What gcc options guarantee more portable C code 28

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top