From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Jonathan Gray <jsg-pTb1tGJk1dCHXe+LvDLADg@public.gmane.org>
Cc: loeliger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] util: limit gnu_printf format attribute to gcc >= 4.4.0
Date: Sun, 7 Feb 2021 14:23:35 +1100 [thread overview]
Message-ID: <20210207032335.GA6951@yekko.fritz.box> (raw)
In-Reply-To: <20210206100110.75228-1-jsg-pTb1tGJk1dCHXe+LvDLADg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1326 bytes --]
On Sat, Feb 06, 2021 at 09:01:10PM +1100, Jonathan Gray wrote:
> The gnu_printf format attribute was introduced in gcc 4.4.0
> https://gcc.gnu.org/legacy-ml/gcc-help/2012-02/msg00225.html.
>
> Use the printf format attribute on earlier versions of gcc and clang
> (which claims to be gcc 4.2.1 in builtin defines) to fix the build with
> gcc 4.2.1.
>
> Fixes: 588a29f ("util: use gnu_printf format attribute")
> Signed-off-by: Jonathan Gray <jsg-pTb1tGJk1dCHXe+LvDLADg@public.gmane.org>
Applied, thanks.
> ---
> util.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/util.h b/util.h
> index a771b46..c45b2c2 100644
> --- a/util.h
> +++ b/util.h
> @@ -13,10 +13,10 @@
> */
>
> #ifdef __GNUC__
> -#ifdef __clang__
> -#define PRINTF(i, j) __attribute__((format (printf, i, j)))
> -#else
> +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
> #define PRINTF(i, j) __attribute__((format (gnu_printf, i, j)))
> +#else
> +#define PRINTF(i, j) __attribute__((format (printf, i, j)))
> #endif
> #define NORETURN __attribute__((noreturn))
> #else
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2021-02-07 3:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-06 10:01 [PATCH] util: limit gnu_printf format attribute to gcc >= 4.4.0 Jonathan Gray
[not found] ` <20210206100110.75228-1-jsg-pTb1tGJk1dCHXe+LvDLADg@public.gmane.org>
2021-02-07 3:23 ` David Gibson [this message]
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=20210207032335.GA6951@yekko.fritz.box \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jsg-pTb1tGJk1dCHXe+LvDLADg@public.gmane.org \
--cc=loeliger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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