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

Re: [RFC/PATCH] headers: normalize the spelling of some header guards

From
Jeff King <peff@peff.net>
Date
Oct 14, 2018, 23:59 UTC
Message-ID
<20181014235950.GA13510@sigill.intra.peff.net>
In-Reply-To
<2804aa4e-c078-c981-be93-27e6e58b2042@ramsayjones.plus.com>
On Sun, Oct 14, 2018 at 09:13:09PM +0100, Ramsay Jones wrote:
Show 18 quoted lines
> This patch is marked RFC because I am not aware of any policy with
> regard to header guard spelling. Having said that, apart from the
> fetch-negotiator.h header, all of these headers are using a reserved
> identifier (see C99 Standard 7.1.3).
>
> These headers were found, thus:
> 
>   $ git grep -n -E '^#ifn?def ' -- '*.h' | grep 'h\:1\:' | grep -v '^compat' | grep -v -E '[A-Z_]*_H$'
>   alias.h:1:#ifndef __ALIAS_H__
>   commit-reach.h:1:#ifndef __COMMIT_REACH_H__
>   fetch-negotiator.h:1:#ifndef FETCH_NEGOTIATOR
>   midx.h:1:#ifndef __MIDX_H__
>   t/helper/test-tool.h:1:#ifndef __TEST_TOOL_H__
>   vcs-svn/fast_export.h:1:#ifndef FAST_EXPORT_H_
>   vcs-svn/line_buffer.h:1:#ifndef LINE_BUFFER_H_
>   vcs-svn/sliding_window.h:1:#ifndef SLIDING_WINDOW_H_
>   vcs-svn/svndiff.h:1:#ifndef SVNDIFF_H_
>   vcs-svn/svndump.h:1:#ifndef SVNDUMP_H_

I think the ones with a trailing underscore are actually OK according to the standard (not sure if your "all of these" was including the ones in vcs-svn ;) ).

I'm in favor of normalizing even the ones that aren't illegal, though I'm OK either way on the vcs-svn bits if they're going away anyway.

-Peff
Previous: brian m. carlsonNext: Ramsay Jones
Message 3 of 5 in “headers: normalize the spelling of some header guards”
  1. headers: normalize the spelling of some header guardsRamsay Jones, Oct 14, 2018
  2. brian m. carlsonOct 14, 2018
  3. Jeff KingOct 14, 2018
  4. Ramsay JonesOct 15, 2018
  5. Junio C HamanoOct 15, 2018

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.