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

Re: [PATCH] CodingGuidelines: mention "static" and "extern"

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Feb 9, 2018, 19:07 UTC
Message-ID
<20180209110738.edbc7a700b689db6967ec86a@google.com>
In-Reply-To
<CAPig+cT_ddVSEvdnMTNhtxWJMm4=DLyq8-hSDXa5X0i6rXa3xA@mail.gmail.com>

On Thu, 8 Feb 2018 18:14:06 -0500 Eric Sunshine <sunshine@sunshineco.com> wrote:

Show 20 quoted lines
> On Thu, Feb 8, 2018 at 4:38 PM, Jeff King <peff@peff.net> wrote:
> > Subject: [PATCH] CodingGuidelines: mention "static" and "extern"
> > [...]
> >
> > Signed-off-by: Jeff King <peff@peff.net>
> > ---
> > diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
> > @@ -386,6 +386,11 @@ For C programs:
> > + - Variables and functions local to a given source file should be marked
> > +   with "static". Variables that are visible to other source files
> > +   must be declared with "extern" in header files. However, function
> > +   declarations should not use "extern", as that is already the default.
> 
> Perhaps:
> 
>     ... as that is already the default, unless declarations in the
>     header are already "extern", in which case consistency
>     may favor mirroring existing usage.
> 
> or something.

I would prefer not mirroring existing usage in this case - I think it's better if the code becomes eventually consistent in not using extern.

Previous: Eric SunshineNext: Jeff King
Message 7 of 16 in “color.h: document and modernize header”
  1. color.h: document and modernize headerStefan Beller, Feb 8, 2018
  2. Jeff KingFeb 8, 2018
  3. Stefan BellerFeb 8, 2018
  4. CodingGuidelines: mention "static" and "extern"Jeff King, Feb 8, 2018
  5. Stefan BellerFeb 8, 2018
  6. Eric SunshineFeb 8, 2018
  7. Jonathan TanFeb 9, 2018
  8. Jeff KingFeb 9, 2018
  9. Eric SunshineFeb 8, 2018
  10. Jeff KingFeb 8, 2018
  11. color.h: document and modernize headerStefan Beller, Feb 12, 2018
  12. Eric SunshineFeb 12, 2018
  13. color.h: document and modernize headerStefan Beller, Feb 13, 2018
  14. Eric SunshineFeb 13, 2018
  15. Eric SunshineFeb 14, 2018
  16. Stefan BellerFeb 14, 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.