git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 7 in “Add the GIT_SENTINEL macro”
  1. Add the GIT_SENTINEL macroRamsay Jones, Jul 18, 2013
  2. Jeff KingJul 18, 2013
  3. Jonathan NiederJul 18, 2013
  4. Junio C HamanoJul 19, 2013
  5. Jonathan NiederJul 19, 2013
  6. Junio C HamanoJul 19, 2013
  7. Ramsay JonesJul 20, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.