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

Re: [PATCH] refspec.h: reinstate 'extern' to fix sparse warning

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 16, 2018, 21:52 UTC
Message-ID
<nycvar.QRO.7.76.6.1805162351050.77@tvgsbejvaqbjf.bet>
In-Reply-To
<CAGZ79kbPNJPtcvbgu81y3UYmKsUd6UNNr9kmQ7qjEfB0ZBTJwQ@mail.gmail.com>
On Wed, 16 May 2018, Stefan Beller wrote:
Show 10 quoted lines
> On Wed, May 16, 2018 at 2:42 PM, Brandon Williams <bmwill@google.com> wrote:
>
> > Though now I'm confused, I thought we were going towards eliminating
> > using the extern keyword? ...of course I guess it means something
> > _slightly_ different when using with a variable vs a function :)
> 
> We're only eliminating it when it is redundant. :-)
> 
> For variables this is not redundant as we need it to tell apart the
> declaration and definition of it, so we have to keep it.

Otherwise we will end up with the variable *defined* for every file that includes that header. And of course those different versions of the same variable would have possibly different values...

Previous: Stefan Beller
Message 4 of 4 in “refspec.h: reinstate 'extern' to fix sparse warning”
  1. refspec.h: reinstate 'extern' to fix sparse warningRamsay Jones, May 16, 2018
  2. Brandon WilliamsMay 16, 2018
  3. Stefan BellerMay 16, 2018
  4. Johannes SchindelinMay 16, 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.