From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 1/6] *.c static functions: don't forward-declare __attribute__
Date: Sat, 10 Jul 2021 10:47:27 +0200 [thread overview]
Message-ID: <patch-1.6-a855bfceb2c-20210710T084445Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.6-00000000000-20210710T084445Z-avarab@gmail.com>
9cf6d3357aa (Add git-index-pack utility, 2005-10-12) and
466dbc42f58 (receive-pack: Send internal errors over side-band #2,
2010-02-10) we added these static functions and forward-declared their
__attribute__((printf)).
I think this may have been to work around some compiler limitation at
the time, but in any case we have a lot of code that uses the briefer
way of declaring these that I'm using here, so if we had any such
issues with compilers we'd have seen them already.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
builtin/index-pack.c | 4 +---
builtin/receive-pack.c | 5 ++---
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 3fbc5d70777..8336466865c 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -369,9 +369,7 @@ static void parse_pack_header(void)
use(sizeof(struct pack_header));
}
-static NORETURN void bad_object(off_t offset, const char *format,
- ...) __attribute__((format (printf, 2, 3)));
-
+__attribute__((format (printf, 2, 3)))
static NORETURN void bad_object(off_t offset, const char *format, ...)
{
va_list params;
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index a34742513ac..2d1f97e1ca7 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -425,9 +425,6 @@ static int proc_receive_ref_matches(struct command *cmd)
return 0;
}
-static void rp_error(const char *err, ...) __attribute__((format (printf, 1, 2)));
-static void rp_warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
-
static void report_message(const char *prefix, const char *err, va_list params)
{
int sz;
@@ -445,6 +442,7 @@ static void report_message(const char *prefix, const char *err, va_list params)
xwrite(2, msg, sz);
}
+__attribute__((format (printf, 1, 2)))
static void rp_warning(const char *err, ...)
{
va_list params;
@@ -453,6 +451,7 @@ static void rp_warning(const char *err, ...)
va_end(params);
}
+__attribute__((format (printf, 1, 2)))
static void rp_error(const char *err, ...)
{
va_list params;
--
2.32.0.636.g43e71d69cff
next prev parent reply other threads:[~2021-07-10 8:47 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-10 8:47 [PATCH 0/6] add missing __attribute__((format)) Ævar Arnfjörð Bjarmason
2021-07-10 8:47 ` Ævar Arnfjörð Bjarmason [this message]
2021-07-10 8:47 ` [PATCH 2/6] sequencer.c: move static function to avoid forward decl Ævar Arnfjörð Bjarmason
2021-07-10 8:47 ` [PATCH 3/6] *.c static functions: add missing __attribute__((format)) Ævar Arnfjörð Bjarmason
2021-07-10 8:47 ` [PATCH 4/6] *.h: add a few " Ævar Arnfjörð Bjarmason
2021-07-11 23:05 ` Ævar Arnfjörð Bjarmason
2021-07-12 20:09 ` Jeff King
2021-07-10 8:47 ` [PATCH 5/6] bugreport.c: tweak cmd_bugreport() to use __attribute__((printf)) Ævar Arnfjörð Bjarmason
2021-07-12 19:39 ` Junio C Hamano
2021-07-10 8:47 ` [PATCH 6/6] git-compat-util.h: add __attribute__((printf)) to git_*printf* Ævar Arnfjörð Bjarmason
2021-07-12 20:13 ` Jeff King
2021-07-12 20:26 ` Randall S. Becker
2021-07-12 21:45 ` Jeff King
2021-07-12 21:58 ` Randall S. Becker
2021-07-12 20:14 ` [PATCH 0/6] add missing __attribute__((format)) Jeff King
2021-07-13 8:05 ` [PATCH v2 " Ævar Arnfjörð Bjarmason
2021-07-13 8:05 ` [PATCH v2 1/6] *.c static functions: don't forward-declare __attribute__ Ævar Arnfjörð Bjarmason
2021-07-13 8:05 ` [PATCH v2 2/6] sequencer.c: move static function to avoid forward decl Ævar Arnfjörð Bjarmason
2021-07-13 8:05 ` [PATCH v2 3/6] *.c static functions: add missing __attribute__((format)) Ævar Arnfjörð Bjarmason
2021-07-13 8:05 ` [PATCH v2 4/6] *.h: add a few " Ævar Arnfjörð Bjarmason
2021-07-13 8:05 ` [PATCH v2 5/6] advice.h: add missing __attribute__((format)) & fix usage Ævar Arnfjörð Bjarmason
2021-07-13 8:05 ` [PATCH v2 6/6] strbuf.h: add a comment about "missing" strftime() checking Ævar Arnfjörð Bjarmason
2021-07-13 21:15 ` Jeff King
2021-07-13 21:17 ` [PATCH v2 0/6] add missing __attribute__((format)) Jeff King
2021-07-13 22:29 ` Junio C Hamano
2021-07-13 23:05 ` Ævar Arnfjörð Bjarmason
2021-07-14 0:15 ` [PATCH v3 0/5] " Ævar Arnfjörð Bjarmason
2021-07-14 0:15 ` [PATCH v3 1/5] *.c static functions: don't forward-declare __attribute__ Ævar Arnfjörð Bjarmason
2021-07-14 0:15 ` [PATCH v3 2/5] sequencer.c: move static function to avoid forward decl Ævar Arnfjörð Bjarmason
2021-07-14 0:15 ` [PATCH v3 3/5] *.c static functions: add missing __attribute__((format)) Ævar Arnfjörð Bjarmason
2021-07-14 0:15 ` [PATCH v3 4/5] *.h: add a few " Ævar Arnfjörð Bjarmason
2021-07-14 0:15 ` [PATCH v3 5/5] advice.h: add missing __attribute__((format)) & fix usage Ævar Arnfjörð Bjarmason
2021-07-14 16:07 ` [PATCH v3 0/5] add missing __attribute__((format)) Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=patch-1.6-a855bfceb2c-20210710T084445Z-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).