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

[PATCH] Add "extern" qualifier to function declarations in header files

From
Stephan Beyer <s-beyer@gmx.net>
Date
Aug 11, 2008, 23:32 UTC
Message-ID
<1218497539-9545-1-git-send-email-s-beyer@gmx.net>

This patch prepends "extern " to function declarations in all header files in the root source directory.

Lines that were longer then 80 characters, are kept this way. Declarations with more than 80 characters that were stretched over several lines, are reindented if the indentation followed some logic.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
Hi,
Junio wrote in <7vod3zuqpv.fsf@gitster.siamese.dyndns.org>:
> > Is this a mistake that some forward declarations in header files are not
> > declared "extern"?
> 
> Yup, that looks old fashioned.

Ok, so I changed this, though I think it's not really useful because it's really only cosmetic. (But I needed some very simple task to bring me down to make me go to bed now.) ;-)

The patch itself is 53kiB, so it's not inline-attached, but can be found
on
	http://pkqs.net/~sbeyer/tmp/extern.patch
or the commit can be fetched from
	git://repo.or.cz/git/sbeyer.git extern

I've grepped through *.h and it seems that no function declaration is left without either "static inline" or "extern" now.

 attr.h            |    4 +-
 blob.h            |    6 ++--
 branch.h          |    7 +++--
 bundle.h          |   14 +++++-----
 cache-tree.h      |   18 ++++++------
 cache.h           |   50 ++++++++++++++++++------------------
 color.h           |   10 +++---
 commit.h          |   72 ++++++++++++++++++++++++++--------------------------
 diff.h            |    2 +-
 diffcore.h        |    6 ++--
 fetch-pack.h      |    2 +-
 fsck.h            |    6 ++--
 git-compat-util.h |    8 +++---
 graph.h           |   24 +++++++++---------
 list-objects.h    |    4 +-
 ll-merge.h        |   12 ++++----
 log-tree.h        |   20 +++++++-------
 mailmap.h         |    4 +-
 merge-recursive.h |   26 +++++++++---------
 object.h          |   24 +++++++++---------
 pack-refs.h       |    2 +-
 pack-revindex.h   |    2 +-
 patch-ids.h       |    8 +++---
 pkt-line.h        |    8 +++---
 progress.h        |   16 ++++++-----
 quote.h           |    4 +-
 refs.h            |    4 +-
 remote.h          |   51 ++++++++++++++++++++-----------------
 revision.h        |    2 +-
 run-command.h     |   16 ++++++------
 send-pack.h       |    6 ++--
 shortlog.h        |    6 ++--
 sideband.h        |    4 +-
 string-list.h     |   16 ++++++------
 transport.h       |   19 +++++++------
 tree-walk.h       |   12 ++++----
 tree.h            |    8 +++---
 unpack-trees.h    |   10 +++---
 utf8.h            |   12 ++++----
 walker.h          |   15 ++++++-----
 wt-status.h       |    6 ++--
 xdiff-interface.h |   14 +++++-----
 42 files changed, 284 insertions(+), 276 deletions(-)
Message 1 of 1 in “Add "extern" qualifier to function declarations in header files”
  1. Add "extern" qualifier to function declarations in header filesStephan Beyer, Aug 11, 2008

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.