Re: [PATCH] Add the GIT_SENTINEL macro
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jul 19, 2013, 03:36 UTC
- Message-ID
- <20130719033634.GB27853@google.com>
- In-Reply-To
- <7vr4evz0oc.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> It seems to apply well on the tip of jk/gcc-function-attributes. > > - This macro is not about "git" at all, so I'll edit the patch to > call it GCC_ATTR_SENTINEL before applying.
Would naming it something like LAST_ARG_MUST_BE_NULL instead make sense? That way, if some other compiler gains a different syntax for the same annotation, it would be possible to do
#if defined(__GNUC__) && __GNUC__ >= 4 # define LAST_ARG_MUST_BE_NULL __attribute__((sentinel)) #elif defined(_MSC_VER) && _MSC_VER > 27 # define LAST_ARG_MUST_BE_NULL __declspec(lastargnull) #else # define LAST_ARG_MUST_BE_NULL #endif