lkml.org 
[lkml]   [2018]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH 1/7] compiler_attributes.h: add __attribute__((format_arg)) shorthand
Hi Rasmus,

On Sat, Oct 27, 2018 at 1:24 AM Rasmus Villemoes
<linux@rasmusvillemoes.dk> wrote:
>
> diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
> index 6b28c1b7310c..08264df52322 100644
> --- a/include/linux/compiler_attributes.h
> +++ b/include/linux/compiler_attributes.h
> @@ -32,6 +32,7 @@
> # define __GCC4_has_attribute___assume_aligned__ (__GNUC_MINOR__ >= 9)
> # define __GCC4_has_attribute___designated_init__ 0
> # define __GCC4_has_attribute___externally_visible__ 1
> +# define __GCC4_has_attribute___format_arg__ 1

Thank you Rasmus for doing this already on top of this tree!

> # define __GCC4_has_attribute___noclone__ 1
> # define __GCC4_has_attribute___optimize__ 1
> # define __GCC4_has_attribute___nonstring__ 0
> @@ -140,6 +141,18 @@
> #define __printf(a, b) __attribute__((__format__(printf, a, b)))
> #define __scanf(a, b) __attribute__((__format__(scanf, a, b)))
>
> +/*
> + * Optional

I did quick check and gcc >= 4.1, clang >= 3.0, icc >= 13 compilers
seem to support it (or at least recognize it, even if they just ignore
it), so we do not need to make it optional, no? Did I miss some case?

Thanks!

Cheers,
Miguel

\
 
 \ /
  Last update: 2018-10-27 14:07    [W:0.137 / U:0.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site