From: Jeff Hostetler Date: Mon, 26 Mar 2018 17:36:41 GMT Subject: Re: [RFC PATCH v2 1/1] json-writer: add cast to uintmax_t Message-ID: In-Reply-To: <1a6a4983b824e7b9f4eb1f7b83a39d24f72e552f.1521916335.git.wink@saville.com> On 3/24/2018 2:38 PM, Wink Saville wrote: > Correct a compile error on Mac OSX by adding a cast to uintmax_t > in calls to strbuf_addf. > > Helped-by: Ramsay Jones > Tested-by: travis-ci > Signed-off-by: Wink Saville > --- > json-writer.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/json-writer.c b/json-writer.c > index 89a6abb57..1f40482ff 100644 > --- a/json-writer.c > +++ b/json-writer.c > @@ -120,7 +120,7 @@ void jw_object_uint64(struct json_writer *jw, const char *key, uint64_t value) > maybe_add_comma(jw); > > append_quoted_string(&jw->json, key); > - strbuf_addf(&jw->json, ":%"PRIuMAX, value); > + strbuf_addf(&jw->json, ":%"PRIuMAX, (uintmax_t)value); > } > > void jw_object_double(struct json_writer *jw, const char *fmt, > @@ -225,7 +225,7 @@ void jw_array_uint64(struct json_writer *jw, uint64_t value) > assert_in_array(jw); > maybe_add_comma(jw); > > - strbuf_addf(&jw->json, "%"PRIuMAX, value); > + strbuf_addf(&jw->json, "%"PRIuMAX, (uintmax_t)value); > } > > void jw_array_double(struct json_writer *jw, const char *fmt, double value) > FYI. I included and squashed this change into V4 of my json-writer series. Jeff