mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <>
Cc: Ahmad Fatoum <>
Subject: [PATCH 2/2] compiler: fix __attribute__((format(printf, sandbox incompatibility
Date: Mon,  7 Feb 2022 08:56:04 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On sandbox, we define printf to barebox_printf for the non-sandbox
specific parts to avoid clashing with the libc-provided symbol. This is
substituted into the definition of __printf, leading to

  test/self/printf.c:37:1: warning: ‘barebox_printf’ is an
	unrecognized format function type [-Wformat=]

Avoid this by using the equivalent reserved keyword, which doesn't
clash. While at it, be a little future proof and do the same for scanf
as well.

Signed-off-by: Ahmad Fatoum <>
 include/linux/compiler_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 9a5a6f0e8b17..aa9cbcac7740 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -201,8 +201,8 @@ struct ftrace_likely_data {
 #define __pure			__attribute__((pure))
 #define __aligned(x)		__attribute__((aligned(x)))
 #define __aligned_largest	__attribute__((aligned))
-#define __printf(a, b)		__attribute__((format(printf, a, b)))
-#define __scanf(a, b)		__attribute__((format(scanf, a, b)))
+#define __printf(a, b)		__attribute__((format(__printf__, a, b)))
+#define __scanf(a, b)		__attribute__((format(__scanf__, a, b)))
 #define __maybe_unused		__attribute__((unused))
 #define __always_unused		__attribute__((unused))
 #define __mode(x)		__attribute__((mode(x)))

barebox mailing list

  reply	other threads:[~2022-02-07  7:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07  7:56 [PATCH 1/2] sandbox: symlink stickypage.bin into build directory Ahmad Fatoum
2022-02-07  7:56 ` Ahmad Fatoum [this message]
2022-02-07  8:09 ` Sascha Hauer

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* 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