This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Best command line options for debug/release builds


Hi everyone,

I have a project that is intended to be run with debugging turned on. It's a Wikipedia bot, so performance is not a priority, while having the code detect and report all possible errors without damaging Wikipedia *is* a priority. I'm not running it within a debugger, but I want the code to be internally safe (eg it pads string arrays with extra chars just in case they get accidentally overwritten, it checks for NULL before dereferencing a pointer, etc.)

Now, in order to get my code running as a 'release' build, I have always thought that one selects either -O2 or -O3 and that's it, while to run it as a debug build means simply to remove the -Ox option. But there's more to a 'debug' build than that. What are your favourite command line options to get a 'debug' build, or a 'release' build?

Richard



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]