using Dev-C++ to compile ONLY C code ?

  • Thread starter Emanuele Blanco
  • Start date
E

Emanuele Blanco

Hi there,

don't know if it's the right group, but I'll try anyway. Sorry if I'm OT,
anybody can be so patient to tell me the right group ? Thanks :)

Anyway, the question is:

I know I can write C programs using a C++ environment like Dev-C++. However,
I'd like to know if there are some options that allow Dev to ignore C++
syntax and act as a C-only compiler. Is this possible ? And, if not, can
anybody suggest me a free C compiler under Windows ?

Thanks a lot.
 
I

Irrwahn Grausewitz

Emanuele Blanco said:
Hi there,

don't know if it's the right group, but I'll try anyway. Sorry if I'm OT,
anybody can be so patient to tell me the right group ? Thanks :)

Anyway, the question is:

I know I can write C programs using a C++ environment like Dev-C++. However,
I'd like to know if there are some options that allow Dev to ignore C++
syntax and act as a C-only compiler. Is this possible ?

<OT>
Since Dev-C++ is in fact an IDE that comes with the MingW port of gcc,
the answer is, of course, yes. Name your files <name>.c and add the
following options to the compiler command line in order to invoke gcc
in C89 conforming mode:

-W -Wall -O<n> -std=c89 -pedantic

Notes:
1. replace <n> with a number in [1;3], or s
2. -std=c89 replaces the deprecated -ansi option
3. -std=c99 is possible too, but several C99 features have not
been implemented in gcc yet

</OT>

Please direct further implementation specific questions to either
gnu.gcc.help or the online forum at http://www.bloodshed.net/forum .

For standard C language questions comp.lang.c is however /the/ place
to ask, just be sure to read the FAQ and welcome message (links
provided in signature) and lurk for a while before posting.

HTH, good luck
Regards
 

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

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,362
Latest member
ChandaWagn

Latest Threads

Top