C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 12-30-2005, 05:53 PM   #1
Registered User
 
Join Date: Dec 2005
Posts: 32
Dev-cpp - compiler options

I just recently switched to Dev-Cpp 4.9.9.2 and I'm wondering how I can force the compiler to conform to ANSI C and such things. As it is now, it lets me get away with quite a lot of strange things. ;) I of course tinkered with as much as I could in all the menus, but without much luck. Do I need to pass parameters to the compiler manually (I did notice a few parameter boxes here and there)? I'm sure there must be a guide to this somewhere? Please point me in the right direction!

Happy new year, and thanks for all previous replies to my threads! (I do read everything you guys write, it's just that I've been a bit lazy posting back. ;)

-tretton
tretton is offline   Reply With Quote
Old 12-30-2005, 05:56 PM   #2
and the hat of vanishing
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,214
You should be able to set up any additional command line parameters you want.
I use these when compiling for ANSI, and wanting maximum diagnostics
-W -Wall -ansi -pedantic -O2

All the gory details on what all available gcc compiler options are here
http://www.gnu.org/software/gcc/onlinedocs/
Salem is offline   Reply With Quote
Old 12-30-2005, 05:58 PM   #3
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,629
The Compiler Options dialog box lets you tweak lots of things as well.
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, etc.

New project: nort
dwks is offline   Reply With Quote
Old 12-30-2005, 06:22 PM   #4
Registered User
 
Join Date: Dec 2005
Posts: 32
D*mn, you guys are fast. Thanks!

The -pedantic parameter actually gives me a lot of warnings in stdio, about long long not being allowed and such. I find this very odd. I believe long long is [edit]C99[/edit], but still, what can I do about headers?

Last edited by tretton; 12-30-2005 at 06:29 PM.
tretton is offline   Reply With Quote
Old 01-06-2006, 02:54 PM   #5
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,629
Quote:
The -pedantic parameter actually gives me a lot of warnings in stdio
Really? Can you post them?

Try compiling your program from the command line, too.
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, etc.

New project: nort
dwks is offline   Reply With Quote
Old 01-06-2006, 05:38 PM   #6
Registered User
 
Join Date: Dec 2005
Posts: 32
Here's the compiler output from Dev-Cpp:

Code:
Compiler: Default compiler
Building Makefile: "C:\Program\Dev-Cpp\Projects\TruthTable\Makefile.win"
Executing  make clean
rm -f obj/operations.o obj/truthtest.o  release/TruthTable.exe

gcc.exe -c source/operations.c -o obj/operations.o -I"C:/Program/Dev-Cpp/include"  -Wextra -Wall  -pedantic -O2   

In file included from source/operations.c:14:
C:/Program/Dev-Cpp/include/stdio.h:330: warning: ISO C90 does not support `long long'

In file included from C:/Program/Dev-Cpp/include/stdio.h:399,
                 from source/operations.c:14:
C:/Program/Dev-Cpp/include/sys/types.h:32: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/sys/types.h:110: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/sys/types.h:115: warning: ISO C90 does not support `long long'

In file included from source/operations.c:14:
C:/Program/Dev-Cpp/include/stdio.h:416:14: warning: use of C99 long long integer constant

gcc.exe -c source/truthtest.c -o obj/truthtest.o -I"C:/Program/Dev-Cpp/include"  -Wextra -Wall  -pedantic -O2   

In file included from source/truthtest.c:17:
C:/Program/Dev-Cpp/include/stdlib.h:421: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:422: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:423: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:424: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:425: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:426: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:476: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:476: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:478: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:478: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:480: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:480: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:481: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:482: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:484: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:485: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:488: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:491: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:492: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:493: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:494: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:495: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:499: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:500: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:502: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:505: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/stdlib.h:506: warning: ISO C90 does not support `long long'

C:/Program/Dev-Cpp/include/stdlib.h:508: warning: ISO C90 does not support `long long'
In file included from source/truthtest.c:18:
C:/Program/Dev-Cpp/include/stdio.h:330: warning: ISO C90 does not support `long long'
In file included from C:/Program/Dev-Cpp/include/stdio.h:399,
                 from source/truthtest.c:18:
C:/Program/Dev-Cpp/include/sys/types.h:32: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/sys/types.h:110: warning: ISO C90 does not support `long long'
C:/Program/Dev-Cpp/include/sys/types.h:115: warning: ISO C90 does not support `long long'

In file included from source/truthtest.c:18:
C:/Program/Dev-Cpp/include/stdio.h:416:14: warning: use of C99 long long integer constant

gcc.exe obj/operations.o obj/truthtest.o  -o "release\TruthTable.exe" -L"C:/Program/Dev-Cpp/lib"  

Execution terminated
Compilation successful
Here's the output from the console issuing the following command:

C:\Program\Dev-Cpp\Projects\TruthTable>c:\program\dev-cpp\bin\gcc.exe -c source/operations.c -o obj/operations.o -I"C:/Program/Dev-Cpp/include" -Wextra -Wall -pedantic -O2:

Code:
In file included from source/operations.c:14:
C:/Program/Dev-Cpp/include/stdio.h:330: warning: ISO C90 does not support `long
long'
In file included from C:/Program/Dev-Cpp/include/stdio.h:399,
                 from source/operations.c:14:
C:/Program/Dev-Cpp/include/sys/types.h:32: warning: ISO C90 does not support `lo
ng long'
C:/Program/Dev-Cpp/include/sys/types.h:110: warning: ISO C90 does not support `l
ong long'
C:/Program/Dev-Cpp/include/sys/types.h:115: warning: ISO C90 does not support `l
ong long'
In file included from source/operations.c:14:
C:/Program/Dev-Cpp/include/stdio.h:416:14: warning: use of C99 long long integer
 constant
As soon as I add -Wno-long-long everything is fine.
tretton is offline   Reply With Quote
Old 01-06-2006, 06:08 PM   #7
...
 
kermit's Avatar
 
Join Date: Jan 2003
Posts: 1,190
Did you try the flag -std=c99 ??
__________________
Got Ed?

sys-sizes
kermit is offline   Reply With Quote
Old 01-06-2006, 06:20 PM   #8
Registered User
 
Join Date: Dec 2005
Posts: 32
Sorry, my -ansi somehow got lost in the mix. :S It's supposed to be ANSI C, nothing else. Yes, -std-c99 also solves the problem.
tretton is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which Compiler? Bladactania C Programming 10 02-11-2009 01:32 AM
[resolved] internal compiler error... bling C++ Programming 2 12-10-2008 12:57 PM
added start menu crashes game avgprogamerjoe Game Programming 6 08-29-2007 01:30 PM
Multiple Cpp Files w4ck0z C++ Programming 5 11-14-2005 02:41 PM
Dev C++ Compiler, Indentation? Zeusbwr C++ Programming 3 10-21-2004 06:13 AM


All times are GMT -6. The time now is 01:04 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22