Re: [PATCH] rename FORMAT_ATTR() to __printf(), ...

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

 




On 08/06/18 21:26, Luc Van Oostenryck wrote:
> likewise for NORETURN_ATTR & SENTINEL_ATTR.
> 
> The goal is to win a bit of screen real estate. It also doesn't
> hurt to be closer to what is done in the kernel.
> 

[snip]

> diff --git a/lib.h b/lib.h
> index 0e5f3e4a8..44b2fb020 100644
> --- a/lib.h
> +++ b/lib.h
> @@ -89,25 +89,21 @@ struct token *expect(struct token *, int, const char *);
>  void unexpected(struct token *, const char *errmsg);
>  
>  #ifdef __GNUC__
> -#define FORMAT_ATTR(pos) __attribute__ ((__format__ (__printf__, pos, pos+1)))
> -#define NORETURN_ATTR __attribute__ ((__noreturn__))
> -#define SENTINEL_ATTR __attribute__ ((__sentinel__))
> +#define __printf(pos) __attribute__((__format__(__printf__, pos, pos+1)))
> +#define __noreturn    __attribute__((__noreturn__))
> +#define __sentinel    __attribute__((__sentinel__))
>  #else
> -#define FORMAT_ATTR(pos)
> -#define NORETURN_ATTR
> -#define SENTINEL_ATTR
> +#define __printf(pos)
> +#define __noreturn
> +#define __sentinel
>  #endif

__printf, __noreturn and __sentinel are all reserved identifiers
and should not be used (C99 7.1.3). [The situation in the kernel,
or an embedded (non-hosted) platform is a different issue.]

Yes, I know that there are already some such symbols in sparse.
That is no reason to add more! ;-)

[I suspect that some people will disagree, saying that I'm just
an old curmudgeon! Well, OK. :) ]

Perhaps just removing the '_ATTR' part of the symbol would be
sufficient. ie. FORMAT(pos), NORETURN and SENTINEL.

ATB,
Ramsay Jones


--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux