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

Re: [RFC PATCH] Move SHA-1 implementation selection into a header file

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Mar 14, 2017, 23:42 UTC
Message-ID
<1fce97df-7eb8-79d5-b96b-2086746bf19d@ramsayjones.plus.com>
In-Reply-To
<xmqq1stzio5b.fsf@gitster.mtv.corp.google.com>
On 14/03/17 20:44, Junio C Hamano wrote:
Show 19 quoted lines
> OK, then I'll queue this.  The selection still goes to BASIC_CFLAGS
> so the dependencies for re-compilation should be right, I'd think.
> 
> -- >8 --
> From: "brian m. carlson" <sandals@crustytoothpaste.net>
> Date: Sat, 11 Mar 2017 22:28:18 +0000
> Subject: [PATCH] hash.h: move SHA-1 implementation selection into a header file
> 
> Many developers use functionality in their editors that allows for quick
> syntax checks, including warning about questionable constructs.  This
> functionality allows rapid development with fewer errors.  However, such
> functionality generally does not allow the specification of
> project-specific defines or command-line options.
> 
> Since the SHA1_HEADER include is not defined in such a case, developers
> see spurious errors when using these tools.  Furthermore, while using a
> macro as the argument to #include is permitted by C11, it isn't
> permitted by C89 and C99, and there are known implementations which
> reject it.

C99 certainly allows a macro argument to #include (see, 6.10.2-4; there is also an example in 6.10.2-8).

I can't remember if it's allowed in C89/C90 (I think it is). I only have immediate access to the C99 and C11 standards (and I can't be bothered to search), so I can't say for sure.

ATB, Ramsay Jones

Previous: Jonathan NiederNext: brian m. carlson
Message 11 of 16 in “Move SHA-1 implementation selection into a header file”
  1. Move SHA-1 implementation selection into a header filebrian m. carlson, Mar 11, 2017
  2. Jeff KingMar 12, 2017
  3. brian m. carlsonMar 12, 2017
  4. Jeff KingMar 12, 2017
  5. Junio C HamanoMar 12, 2017
  6. Jonathan NiederMar 14, 2017
  7. Jeff KingMar 14, 2017
  8. Junio C HamanoMar 14, 2017
  9. Jeff KingMar 14, 2017
  10. Jonathan NiederMar 14, 2017
  11. Ramsay JonesMar 14, 2017
  12. brian m. carlsonMar 14, 2017
  13. Ramsay JonesMar 15, 2017
  14. Junio C HamanoMar 15, 2017
  15. Ramsay JonesMar 15, 2017
  16. Jonathan NiederMar 14, 2017

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.