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

[PATCH] clean up extern decl of functions

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 8, 2020, 15:27 UTC
Message-ID
<xmqq8scgzqis.fsf@gitster.c.googlers.com>

Among external function declarations, somehow only these two functions that return pointer-to-function were declared with "extern" in front.

Ideally, we should standardise to _have_ explicit "extern" in front for all function (and data) decls, but let's make things uniform first. Bulk re-addition of extern can be done without any extra difficulty with or without this change.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * A patch before morning coffee, could be totally off the mark with
   trivial thinko.
 git-compat-util.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index 7a0fb7a045..56e0e1e79d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -491,9 +491,9 @@ static inline int const_error(void)
 
 void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));
 void set_error_routine(void (*routine)(const char *err, va_list params));
-extern void (*get_error_routine(void))(const char *err, va_list params);
+void (*get_error_routine(void))(const char *err, va_list params);
 void set_warn_routine(void (*routine)(const char *warn, va_list params));
-extern void (*get_warn_routine(void))(const char *warn, va_list params);
+void (*get_warn_routine(void))(const char *warn, va_list params);
 void set_die_is_recursing_routine(int (*routine)(void));
 
 int starts_with(const char *str, const char *prefix);
Next: Denton Liu
Message 1 of 15 in “clean up extern decl of functions”
  1. clean up extern decl of functionsJunio C Hamano, Oct 8, 2020
  2. Denton LiuOct 9, 2020
  3. Junio C HamanoOct 9, 2020
  4. Junio C HamanoOct 9, 2020
  5. [RFC] CodingGuidelines: mark external declarations with "extern"Junio C Hamano, Oct 9, 2020
  6. Jeff KingOct 9, 2020
  7. Junio C HamanoOct 9, 2020
  8. Denton LiuOct 9, 2020
  9. Junio C HamanoOct 9, 2020
  10. Đoàn Trần Công DanhOct 10, 2020
  11. Jeff KingOct 15, 2020
  12. Junio C HamanoOct 15, 2020
  13. Jeff KingOct 15, 2020
  14. 1/2 usage: define a type for a reporting functionJeff King, Oct 15, 2020
  15. 2/2 config.mak.dev: build with -fno-commonJeff King, Oct 15, 2020

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.