Re: [PATCH] Add the GIT_SENTINEL macro

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

 



Ramsay Jones wrote:

> This was built on the next branch

All the uses of the sentinel attribute seem to come from
eccb6149 (use "sentinel" function attribute for variadic
lists, 2013-07-09), so this should be okay to go on top of the
jk/gcc-function-attributes branch.

> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -303,6 +303,13 @@ extern char *gitbasename(char *);
>  #endif
>  #endif
>  
> +/* The sentinel attribute is valid from gcc version 4.0 */
> +#if defined(__GNUC__) && (__GNUC__ >= 4)
> +#define GIT_SENTINEL(n) __attribute__((sentinel(n)))
> +#else
> +#define GIT_SENTINEL(n)
> +#endif

I'd mildly prefer

	#if ...
	#define GIT_SENTINEL __attribute__((sentinel))
	#else
	...

(without the numeric parameter).  I don't know any function in git
(or any other project for that matter) that takes extra parameters
after the NULL sentinel.

But I don't care much, so

Reviewed-by: Jonathan Nieder <jrnieder@xxxxxxxxx>

Thanks for a pleasant patch.
Jonathan
--
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]