Re: [PATCH 03/22] argv-array.h: use the FORMATPRINTF macro to declare the gcc function attribute 'format printf'

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

 



Elia Pinto <gitter.spiros@xxxxxxxxx> writes:

> Use the new FORMATPRINTF macro (in git-compat-util.h) to declare the gcc function
> attribute 'format printf'
>
> Signed-off-by: Elia Pinto <gitter.spiros@xxxxxxxxx>
> ---
>  argv-array.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/argv-array.h b/argv-array.h
> index a2fa0aa..e303dfd 100644
> --- a/argv-array.h
> +++ b/argv-array.h
> @@ -13,7 +13,7 @@ struct argv_array {
>  
>  void argv_array_init(struct argv_array *);
>  void argv_array_push(struct argv_array *, const char *);
> -__attribute__((format (printf,2,3)))
> +FORMATPRINTF(2,3)
>  void argv_array_pushf(struct argv_array *, const char *fmt, ...);
>  LAST_ARG_MUST_BE_NULL
>  void argv_array_pushl(struct argv_array *, ...);

OK, this may answer my previous question.

It might be pleasing to the eyes when these two macros appearing
together in all CAPS, making them look similar and consistent,
perhaps with two more tweaks:

 - Imitate LAST_ARG_MUST_BE_NULL and spell it FORMAT_PRINTF;

 - Consistently have SP after comma, i.e. FORMAT_PRINTF(2, 3),
   or to make it obvious that this thing is a special magic, drop SP
   (i.e. this patch would stay the same but some other patches left
   a space after comma, which made them look more inconsistent).

Thanks.  I am not 100% sold on this yet, though.



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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]