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

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 <a.fatoum@pengutronix.de>
---
 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)))
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  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:
  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=20220207075604.1014259-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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