Re: [PATCH 00/22] add the FORMATPRINTF macro to declare the gcc function
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 11, 2016, 17:59 UTC
- Message-ID
- <xmqq37szxh52.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <1455194339-859-1-git-send-email-gitter.spiros@gmail.com>
Elia Pinto <gitter.spiros@gmail.com> writes:
Show 6 quoted lines
> Add the FORMATPRINTF macro for declaring the gcc function attribute 'format printf' > for code style consistency with similar macro that git already use for other gcc > attributes. And use it where necessary. > > Elia Pinto (22): > git-compat-util.h: add the FORMATPRINTF macro
Hmm. Given that we already have
#ifndef __GNUC__ #ifndef __attribute__ #define __attribute__(x) #endif #endif
in git-compat-util.h, it is really between:
__attribute__((format (printf, 1, 2)))
void advise(const char *advice, ...); __attribute__((format (printf,2,3)))
extern void strbuf_addf(struct strbuf *sb, const char *fmt, ...);and
FORMATPRINTF(1,2)
void advise(const char *advice, ...); FORMATPRINTF(2,3)
extern void strbuf_addf(struct strbuf *sb, const char *fmt, ...);Perhaps I am biased for staring at our source code for too long, but somehow the latter looks unnecessarily loud, spelled in all caps.
I dunno. What does this really buy us?