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

Re: [PATCH] git-compat-util.h: GCC deprecated only takes a message in GCC 4.5+

From
Jeff King <peff@peff.net>
Date
Oct 6, 2022, 12:16 UTC
Message-ID
<Yz7HGAThrOcPdmjm@coredump.intra.peff.net>
In-Reply-To
<221006.86lepts927.gmgdl@evledraar.gmail.com>
On Thu, Oct 06, 2022 at 09:29:11AM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 6 quoted lines
> > This will cause some mild hardships, as later patches will need to
> > #define UNUSED in other spots, as well, in order to get full coverage of
> > the code base (I have written those annotation patches, but they're not
> > applied upstream yet).
> 
> Sorry about any trouble in having to rebase those on UNUSED.
That part was not too bad, and is already done.

The trickiest part is that the headers get included in odd orders, and if the macros don't match, the compiler will complain (this has to do with compat/ headers which don't necessarily start by including git-compat-util.h).

But if the definition gets much more complicated, then it's probably worth pulling it out rather than repeating it.

Show 18 quoted lines
> If you're taking requests it would be really useful to prioritize
> changes to shared headers and the like, e.g. DEVOPTS=extra-all on pretty
> much any file will start with:
> 	
> 	git-compat-util.h: In function ‘precompose_argv_prefix’:
> 	git-compat-util.h:313:54: error: unused parameter ‘argc’ [-Werror=unused-parameter]
> 	  313 | static inline const char *precompose_argv_prefix(int argc, const char **argv, const char *prefix)
> 	      |                                                  ~~~~^~~~
> 	git-compat-util.h:313:73: error: unused parameter ‘argv’ [-Werror=unused-parameter]
> 	  313 | static inline const char *precompose_argv_prefix(int argc, const char **argv, const char *prefix)
> 	      |                                                            ~~~~~~~~~~~~~^~~~
> 	git-compat-util.h: In function ‘git_has_dos_drive_prefix’:
> 	git-compat-util.h:423:56: error: unused parameter ‘path’ [-Werror=unused-parameter]
> 	  423 | static inline int git_has_dos_drive_prefix(const char *path)
> 	      |                                            ~~~~~~~~~~~~^~~~
> 	git-compat-util.h: In function ‘git_skip_dos_drive_prefix’:
> 	git-compat-util.h:431:52: error: unused parameter ‘path’ [-Werror=unused-parameter]
> 	  431 | static inline int git_skip_dos_drive_prefix(char **path)

Yeah, those are near the top of my list. I have a group classified as "trivial": functions which are compat placeholders and have no body. I'll be mostly offline for about a week, but I hope to send another round of unused-mark patches when I get back. (Of course it is not really useful until _all_ of the patches are there anyway).

-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 6 of 9 in “git-compat-util.h: GCC deprecated only takes a message in GCC 4.5+”
  1. git-compat-util.h: GCC deprecated only takes a message in GCC 4.5+Aleajndro R Sedeño, Oct 3, 2022
  2. brian m. carlsonOct 3, 2022
  3. Alejandro R. SedeñoOct 3, 2022
  4. Jeff KingOct 5, 2022
  5. Ævar Arnfjörð BjarmasonOct 6, 2022
  6. Jeff KingOct 6, 2022
  7. Ævar Arnfjörð BjarmasonOct 6, 2022
  8. Jeff KingOct 11, 2022
  9. Ævar Arnfjörð BjarmasonOct 6, 2022

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.