[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
debug builds with NO optimizations
From: |
John Calcote |
Subject: |
debug builds with NO optimizations |
Date: |
Mon, 06 Feb 2006 16:27:03 -0700 |
Generally, when I build with the DEBUG macro defined, it's because I want to
step through a portion of my code with the debugger. However, I've noticed that
using AC_PROG_CC sets CFLAGS to "-g -O2" on GCC - and tries to use similar
options on other compilers.
I really like the use of this macro because it also attempts to put the
compiler into standard C mode - which has no standard mechnism, so it really
belongs in the macro. I also completely subscribe to the "symbols on all
builds" philosophy, so I too would recommend enabling -g-like functionality on
all possible compilers for all possible build configurations. What I _don't_
agree with is automatically tacking in a -O2 * who thought that would be a good
idea?
What we really need is a macro that enables optimization levels (such as -Ox),
or completely disables them. Then we can use our various debug flags to
enable/disable them conditionally, as maintainer/programmer configuration
dictates.
My question: Anyone know of a good idiom for managing optimization flags -
including disabling the obligatory -O2 placed in CFLAGS by AC_PROG_CC?
Thanks,
John
-----
John Calcote (address@hidden)
Sr. Software Engineeer
Novell, Inc.
- debug builds with NO optimizations,
John Calcote <=