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

Re: [PATCH] Fix git to be (more) ANSI C99 compliant.

From
THTimo Hirvonen <tihirvon@gmail.com>
Date
Jun 18, 2006, 08:43 UTC
Message-ID
<20060618114352.15191199.tihirvon@gmail.com>
In-Reply-To
<20060618082103.GA1331@verplant.org>
Florian Forster <octo@verplant.org> wrote:
> GCC ignores the FAM in this case and allocates `sizeof (struct
> combine_diff_path)' bytes. However, this is not correct according to
> ANSI and prevents building using other compilers (e.g. Sun cc).
Fair enough.
> To be honest, I don't get the point of FAMs anyways. Why don't we just
> use a pointer to `struct combine_diff_parent' there in the first place?
In general FAMs are used to replace two mallocs with one.
    x = malloc(sizeof(struct foo) + 100)
instead of 
    x = malloc(sizeof(struct foo));
    x->y = malloc(100);
-- 
http://onion.dynserv.net/~timo/
Previous: Florian ForsterNext: Rene Scharfe
Message 5 of 15 in “Fix git to be (more) ANSI C99 compliant.”
  1. Fix git to be (more) ANSI C99 compliant.Florian Forster, Jun 18, 2006
  2. Timo HirvonenJun 18, 2006
  3. Thomas GlanzmannJun 18, 2006
  4. Florian ForsterJun 18, 2006
  5. Timo HirvonenJun 18, 2006
  6. Rene ScharfeJun 18, 2006
  7. Florian ForsterJun 18, 2006
  8. 0/7 Improve ANSI C99 complianceFlorian Forster, Jun 18, 2006
  9. Junio C HamanoJun 18, 2006
  10. Linus TorvaldsJun 18, 2006
  11. Florian ForsterJun 19, 2006
  12. Junio C HamanoJun 20, 2006
  13. Rene ScharfeJun 20, 2006
  14. Junio C HamanoJun 20, 2006
  15. Junio C HamanoJun 21, 2006

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.