Re: [ANNOUNCE] GIT 1.0.7

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [ANNOUNCE] GIT 1.0.7

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:16

"H. Peter Anvin" [off-list ref] writes:
Any reason to not just do:

 	struct frotz {
 		int xyzzy;
 		char nitfol[1]; /* more */
 	};

... which should work on all compilers?
Laziness, especially to avoid having to deal with comments like
"your xmalloc(sizeof(struct frotz) + strlen(nitfol) + 1) should be
xmalloc(sizeof(struct frotz) + strlen(nitfol)), because you
have already one byte for nitfol element."

Re: [ANNOUNCE] GIT 1.0.7

From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2016-06-15 22:42:16

Junio C Hamano wrote:
"H. Peter Anvin" [off-list ref] writes:

quoted
Any reason to not just do:

	struct frotz {
		int xyzzy;
		char nitfol[1]; /* more */
	};

... which should work on all compilers?
Laziness, especially to avoid having to deal with comments like
"your xmalloc(sizeof(struct frotz) + strlen(nitfol) + 1) should be
xmalloc(sizeof(struct frotz) + strlen(nitfol)), because you
have already one byte for nitfol element."
In the case of strings, that's probably a blessing (already accounted 
for the null byte).

	-hpa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help