Re: [PATCH v2 08/12] initial_ref_transaction_commit(): function for initial ref creation

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

Re: [PATCH v2 08/12] initial_ref_transaction_commit(): function for initial ref creation

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:19

Michael Haggerty [off-list ref] writes:
+	struct ref_transaction *t;
+	struct strbuf err = STRBUF_INIT;
+
+	t = ref_transaction_begin(&err);
+	if (!t)
+		die(err.buf);
Yikes, and sorry for sending three messages without consolidating
against the same patch, but

	die("%s", err.buf);

because

extern NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2)));

in its declaration causes -Werror=format-security to barf.

Likewise for a few other instances of the same construct all in 
the same file.

Re: [PATCH v2 08/12] initial_ref_transaction_commit(): function for initial ref creation

From: Michael Haggerty <hidden>
Date: 2016-06-15 23:05:25

On 06/15/2015 08:53 PM, Junio C Hamano wrote:
Michael Haggerty [off-list ref] writes:
quoted
+	struct ref_transaction *t;
+	struct strbuf err = STRBUF_INIT;
+
+	t = ref_transaction_begin(&err);
+	if (!t)
+		die(err.buf);
Yikes, and sorry for sending three messages without consolidating
against the same patch, but

	die("%s", err.buf);

because

extern NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2)));

in its declaration causes -Werror=format-security to barf.

Likewise for a few other instances of the same construct all in 
the same file.
Thanks for catching this. I'll fix it in the re-roll (and also add that
gcc option to my config.mak for the future).

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help