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

[PATCH 2/2] wt-status.h: drop stdio.h include

From
Jeff King <peff@peff.net>
Date
Jun 18, 2019, 15:54 UTC
Message-ID
<20190618155419.GB13431@sigill.intra.peff.net>
In-Reply-To
<20190618155326.GA4014@sigill.intra.peff.net>

We started including stdio.h to pick up the declaration of "FILE" in f26a001226 (Enable wt-status output to a given FILE pointer., 2007-09-17). But there's no need, since headers can assume that git-compat-util.h has been included, which covers stdio.

This should just be redundant, and not hurting anything (like pulling in includes out of order) because C files are supposed to always include git-compat-util.h first. But it's worth cleaning up to model good behavior.

Signed-off-by: Jeff King <peff@peff.net>
---
 wt-status.h | 1 -
 1 file changed, 1 deletion(-)
diff --git a/wt-status.h b/wt-status.h
index 64f1ddc9fd..8849768e92 100644
--- a/wt-status.h
+++ b/wt-status.h
@@ -1,7 +1,6 @@
 #ifndef STATUS_H
 #define STATUS_H
 
-#include <stdio.h>
 #include "string-list.h"
 #include "color.h"
 #include "pathspec.h"
-- 
2.22.0.rc3.685.g5185838c9a
Previous: Jeff KingNext: Carlo Arenas
Message 5 of 17 in “xdiff: avoid accidental redefinition of LFS feature in OpenIndiana”
  1. xdiff: avoid accidental redefinition of LFS feature in OpenIndianaCarlo Marcelo Arenas Belón, Jun 18, 2019
  2. Johannes SchindelinJun 18, 2019
  3. 0/2 a few more redundant system include cleanupsJeff King, Jun 18, 2019
  4. 1/2 verify-tag: drop signal.h includeJeff King, Jun 18, 2019
  5. 2/2 wt-status.h: drop stdio.h includeJeff King, Jun 18, 2019
  6. Carlo ArenasJun 19, 2019
  7. Jeff KingJun 19, 2019
  8. Junio C HamanoJul 3, 2019
  9. Carlo ArenasJul 4, 2019
  10. 0/5 system header cleanupCarlo Marcelo Arenas Belón, Jul 28, 2019
  11. 1/5 verify-tag: drop signal.h includeCarlo Marcelo Arenas Belón, Jul 28, 2019
  12. 2/5 wt-status.h: drop stdio.h includeCarlo Marcelo Arenas Belón, Jul 28, 2019
  13. 3/5 xdiff: drop system includes in xutils.cCarlo Marcelo Arenas Belón, Jul 28, 2019
  14. 5/5 xdiff: remove duplicate headers from xpatience.cCarlo Marcelo Arenas Belón, Jul 28, 2019
  15. 4/5 xdiff: remove duplicate headers from xhistogram.cCarlo Marcelo Arenas Belón, Jul 28, 2019
  16. Jeff KingJul 28, 2019
  17. Junio C HamanoJul 29, 2019

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.