PDA

View Full Version : Making gcc behave more strictly.


Pope Stewart
04-17-2005, 11:13 PM
While making a C program, I ran into some problems. I used the MallocDebug tool to help see if I did memory stuff correctly. I was running into some errors that was driving me crazy.

I brought the program over to linux gcc version 2.96. When trying to compile with that, it noticed that I made a stupid mistake where I started doing some code before declaring all my variables. Once I fixed that, I didn't get an MallocDebug problems.

My question is how can I make apple's gcc behave more strictly so that stuff like that doesn't happen because I get more warnings and errors. I tried using -ansi and all of my // codes got in the way while that didn't happen on the linux gcc 2.96

mrchaotica
04-18-2005, 01:31 AM
In my college classes they require us to use "-ansi -pedantic -02 -Wall". I'm guessing that that'll make it about as strict as you could possibly want.

Pope Stewart
04-18-2005, 07:24 AM
Ahh, thanks. I think the -pedantic was the one that gave me the proper warning.