Thread: Dev-cpp - compiler options

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

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    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/

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    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, nort, etc.

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

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    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, nort, etc.

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

  7. #7
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,534
    Did you try the flag -std=c99 ??

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

Popular pages Recent additions subscribe to a feed

Similar Threads

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