linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Malaterre <malat@debian.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org,
	Mathieu Malaterre <malat@debian.org>
Subject: [PATCH 01/19] xmon: Use __printf markup to silence compiler
Date: Fri, 16 Mar 2018 12:02:06 +0100	[thread overview]
Message-ID: <20180316110224.12260-2-malat@debian.org> (raw)
In-Reply-To: <20180316110224.12260-1-malat@debian.org>

Update also the other prototype declaration in asm/xmon.h.

Silence warnings (triggered at W=1) by adding relevant __printf attribute.
Move #define at bottom of the file to prevent conflict with gcc attribute.

  CC      arch/powerpc/xmon/nonstdio.o
arch/powerpc/xmon/nonstdio.c: In function ‘xmon_printf’:
arch/powerpc/xmon/nonstdio.c:178:2: error: function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
  n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args);
  ^
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/include/asm/xmon.h | 2 +-
 arch/powerpc/xmon/nonstdio.h    | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/include/asm/xmon.h b/arch/powerpc/include/asm/xmon.h
index eb42a0c6e1d9..30ff69bd8f43 100644
--- a/arch/powerpc/include/asm/xmon.h
+++ b/arch/powerpc/include/asm/xmon.h
@@ -29,7 +29,7 @@ static inline void xmon_register_spus(struct list_head *list) { };
 extern int cpus_are_in_xmon(void);
 #endif
 
-extern void xmon_printf(const char *format, ...);
+extern __printf(1, 2) void xmon_printf(const char *format, ...);
 
 #endif /* __KERNEL __ */
 #endif /* __ASM_POWERPC_XMON_H */
diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h
index 2202ec61972c..e8deac6c84e2 100644
--- a/arch/powerpc/xmon/nonstdio.h
+++ b/arch/powerpc/xmon/nonstdio.h
@@ -1,13 +1,13 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 #define EOF	(-1)
 
-#define printf	xmon_printf
-#define putchar	xmon_putchar
-
 extern void xmon_set_pagination_lpp(unsigned long lpp);
 extern void xmon_start_pagination(void);
 extern void xmon_end_pagination(void);
 extern int xmon_putchar(int c);
 extern void xmon_puts(const char *);
 extern char *xmon_gets(char *, int);
-extern void xmon_printf(const char *, ...);
+extern __printf(1, 2) void xmon_printf(const char *fmt, ...);
+
+#define printf	xmon_printf
+#define putchar	xmon_putchar
-- 
2.11.0

  reply	other threads:[~2018-03-16 11:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 11:02 [PATCH 00/19] Start using __printf attribute (single commit series) Mathieu Malaterre
2018-03-16 11:02 ` Mathieu Malaterre [this message]
2018-03-17 23:33   ` [PATCH 01/19] xmon: Use __printf markup to silence compiler kbuild test robot
2018-03-18  0:27   ` kbuild test robot
2018-03-25  9:06   ` [PATCH v2] " Mathieu Malaterre
2018-04-24 18:55     ` Mathieu Malaterre
2018-05-25 11:41     ` [v2] " Michael Ellerman
2018-03-16 11:02 ` [PATCH 02/19] ppc32: change %x into %lx Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 03/19] ppc32: Change %.16x into %p Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 04/19] ppc32: change %lx " Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 05/19] ppc32: change %lx into %tx (ptrdiff_t) Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 06/19] ppc64: change %lx into %llx Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 07/19] ppc64: change %ld into %d Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 08/19] ppc64: change %x into %lx Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 09/19] ppc64: change %016lx into %p Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 10/19] ppc64: change %lx " Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 11/19] ppc64: change %lx into %x Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 12/19] ppc64: change %lx into %llx Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 13/19] ppc64: change %llx into %lx Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 14/19] ppc64: change %p into %llx Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 15/19] ppc64: change %d into %ld Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 16/19] ppc64: Change %d into %lu Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 17/19] ppc64: change %d into %llu Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 18/19] ppc64: change %ld into %d Mathieu Malaterre
2018-03-16 11:02 ` [PATCH 19/19] ppc64: Handle %p format in DUMPPTR() function-like macro Mathieu Malaterre

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=20180316110224.12260-2-malat@debian.org \
    --to=malat@debian.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).