Thread (17 messages) flat view 17 messages, 5 authors, 2016-06-15

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

From: Timo Hirvonen <hidden>
Date: 2016-06-15 22:42:30

Florian Forster [off-list ref] 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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help