Re: [PATCH] Avoid gnu_printf attribute when using Clang

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, Nov 20, 2019 at 09:04:22PM +0000, Ed Maste wrote:
> From: Ed Maste <emaste@xxxxxxxxxxx>
> 
> Clang does not support gnu_printf, so just use printf when using it to
> compile.
> 
> Signed-off-by: Ed Maste <emaste@xxxxxxxxxxx>

Applied, thanks.

> ---
>  util.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/util.h b/util.h
> index 347b305..5a4172d 100644
> --- a/util.h
> +++ b/util.h
> @@ -12,7 +12,11 @@
>   */
>  
>  #ifdef __GNUC__
> +#ifdef __clang__
> +#define PRINTF(i, j)	__attribute__((format (printf, i, j)))
> +#else
>  #define PRINTF(i, j)	__attribute__((format (gnu_printf, i, j)))
> +#endif
>  #define NORETURN	__attribute__((noreturn))
>  #else
>  #define PRINTF(i, j)

-- 
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: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux