LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-16-2007, 06:25 AM   #1
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 547

Rep: Reputation: 38
gcc flags?


what flags shall I use to get the hardest control/check of my code?

now I use -02 -g -ansi and it does not detect a lot of my awful programing like:

....

int i[2];

....

i[3] = 2;

.....

I cant belive i do not get an error exept of a crash when I do run the prog.
 
Old 08-16-2007, 06:44 AM   #2
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 547

Original Poster
Rep: Reputation: 38
ok the -Wall flag should be used. How about the -Wextra? Does anyone use this flag?
 
Old 08-16-2007, 06:53 AM   #3
RichardS
Member
 
Registered: Jul 2007
Posts: 33

Rep: Reputation: 15
Try the:

-fmudflap -fmudflapth -fmudflapir

They might help.

For runtime stuff valgrind does a good job of detecting heap problems. Here is a link about what it can do for you:

http://www.cprogramming.com/debugging/valgrind.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GCC Flags matsko Linux - Software 2 05-14-2007 01:23 PM
Qt tool for gcc flags Ephracis Programming 4 01-15-2006 01:28 AM
flags for compiling Xlib.h in gcc Maidros Programming 2 06-15-2005 05:00 AM
GCC 3.4/3.3 Optimization Flags monohouse Linux - Software 0 10-28-2004 10:48 AM
gcc Pentium3 flags in menuconfig Kristian2 Slackware - Installation 2 06-11-2004 09:49 AM


All times are GMT -5. The time now is 01:09 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration