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

Re: [RFC/PATCH] Add the NO_SENTINEL build variable

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 17, 2013, 16:06 UTC
Message-ID
<7v38rd8925.fsf@alter.siamese.dyndns.org>
In-Reply-To
<51E4338E.4090003@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 13 quoted lines
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 9f1eaca..e846e01 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -300,6 +300,12 @@ extern char *gitbasename(char *);
>  #endif
>  #endif
>  
> +#if defined(__GNUC__) && !defined(NO_SENTINEL)
> +#define SENTINEL(n) __attribute__((sentinel(n)))
> +#else
> +#define SENTINEL(n)
> +#endif

Allowing callers to use __attribute__((sentinel(1)), while it may be a good enhancement, does not belong to "some versions of GCC do not know what to do with the sentinel attribute". Making this change in a separate patch on top would be cleaner.

Also do we know what version of GCC started supporting this attribute? http://gcc.gnu.org/gcc-4.0/changes.html mentions it in "New Languages and Language specific improvements" section, but the page also says "The latest release in the 4.0 release series is GCC 4.0.4", so it is not clear if 4.0 had it, or it was added somewhere between 4.0 and 4.0.4 to me.

Previous: Ramsay JonesNext: Andreas Schwab
Message 6 of 7 in “Add the NO_SENTINEL build variable”
  1. Add the NO_SENTINEL build variableRamsay Jones, Jul 15, 2013
  2. Jonathan NiederJul 15, 2013
  3. Ramsay JonesJul 18, 2013
  4. Junio C HamanoJul 18, 2013
  5. Ramsay JonesJul 20, 2013
  6. Junio C HamanoJul 17, 2013
  7. Andreas SchwabJul 17, 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.