git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Don't optimize code in debug build
@ 2011-02-13  8:32 Piotr Krukowiecki
  2011-02-13  9:36 ` Johannes Sixt
  0 siblings, 1 reply; 4+ messages in thread
From: Piotr Krukowiecki @ 2011-02-13  8:32 UTC (permalink / raw)
  To: git

Code optimization makes debugging harder.

Signed-off-by: Piotr Krukowiecki <piotr.krukowiecki.news@gmail.com>
---
My first patch to this list, so please be gentle ;)

Patch fixes most important problem. There are other improvement possible:
- "-g" is not needed in normal build IMO, I'd move it to debug
- I'd add -O0 -fno-inline to debug too, but maybe it's too gccish
(OTOH there's -g already)

 Makefile |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index ade7923..32d3a69 100644
--- a/Makefile
+++ b/Makefile
@@ -262,7 +262,10 @@ endif

 # CFLAGS and LDFLAGS are for the users to override from the command line.

-CFLAGS = -g -O2 -Wall
+CFLAGS = -g -Wall
+ifndef DEBUG
+CFLAGS += -O2
+endif
 LDFLAGS =
 ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
-- 
1.7.1

-- 
Piotrek

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-13 19:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-13  8:32 [PATCH] Don't optimize code in debug build Piotr Krukowiecki
2011-02-13  9:36 ` Johannes Sixt
     [not found]   ` <AANLkTim6OHU8N7t5RQnt6S7x7ez48RSwp=b82McAC4Oq@mail.gmail.com>
2011-02-13 16:26     ` Piotr Krukowiecki
2011-02-13 19:28   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).