git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Don't optimize code in debug build

From
PKPiotr Krukowiecki <piotr.krukowiecki.news@gmail.com>
Date
Feb 13, 2011, 16:26 UTC
Message-ID
<AANLkTinECgZwFZ0157O-qvYUW1GpJgbsHDekR1WM6gPm@mail.gmail.com>
In-Reply-To
<AANLkTim6OHU8N7t5RQnt6S7x7ez48RSwp=b82McAC4Oq@mail.gmail.com>
(forgot about the list when replying)
Show 22 quoted lines
> On Sun, Feb 13, 2011 at 10:36 AM, Johannes Sixt <j6t@kdbg.org> wrote:
>> On Sonntag, 13. Februar 2011, Piotr Krukowiecki wrote:
>>> --- 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)
>>
>> Instead of this, you can just write
>>
>>  CFLAGS = -g -Wall
>>
>> in your config.mak. Is anything wrong with that?

Several things: I need to know I should remove -O2, I need to keep in sync with other default options, current default is less useful, it requires me to do extra steps. DEBUG is kind of standard - Makefile already uses it in Windows specific part. I suppose we want to keep consistent.

-- 
Piotrek
Previous: Junio C Hamano
Message 4 of 4 in “Don't optimize code in debug build”
  1. Don't optimize code in debug buildPiotr Krukowiecki, Feb 13, 2011
  2. Johannes SixtFeb 13, 2011
  3. Junio C HamanoFeb 13, 2011
  4. Piotr KrukowieckiFeb 13, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.