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

Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 22, 2014, 20:50 UTC
Message-ID
<xmqqoau7js6a.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1411290838-45622-1-git-send-email-sunshine@sunshineco.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
> however, the solution in this patch allows us drop a couple strlen()s in
> favor of sizeof()s.

It is actually not a very good justification when you know you care about the length of the string. A decent compiler ought to know the length of a constant string can be computed at the compilation time.

Let's at least not do that part of the change.
Previous: Jeff KingNext: Eric Sunshine
Message 11 of 12 in “mailinfo: resolve -Wstring-plus-int warning”
  1. mailinfo: resolve -Wstring-plus-int warningEric Sunshine, Sep 21, 2014
  2. Junio C HamanoSep 22, 2014
  3. Eric SunshineSep 22, 2014
  4. Jeff KingSep 23, 2014
  5. Junio C HamanoSep 23, 2014
  6. Jeff KingSep 23, 2014
  7. Eric SunshineSep 23, 2014
  8. Eric SunshineSep 23, 2014
  9. Eric SunshineSep 23, 2014
  10. Jeff KingSep 23, 2014
  11. Junio C HamanoSep 22, 2014
  12. Eric SunshineSep 22, 2014

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.