LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   gcc flags? (http://www.linuxquestions.org/questions/programming-9/gcc-flags-577514/)

kalleanka 08-16-2007 06:25 AM

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.

kalleanka 08-16-2007 06:44 AM

ok the -Wall flag should be used. How about the -Wextra? Does anyone use this flag?

RichardS 08-16-2007 06:53 AM

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


All times are GMT -5. The time now is 05:22 PM.