Skip to content

a few more redundant system include cleanups

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2verify-tag: drop signal.h includebuiltin/verify-commit.c builtin/verify-tag.c+0 -20 replies
2/2wt-status.h: drop stdio.h includewt-status.h+0 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] a few more redundant system include cleanups
Quoted 9 lines · Carlo Marcelo Arenas Belón

after b46054b374 ("xdiff: use git-compat-util", 2019-04-11), two system headers added in 2012 to xutils where no longer needed and could conflict as shown below:

In file included from xdiff/xinclude.h:26:0,

                 from xdiff/xutils.c:25:

./git-compat-util.h:4:0: warning: "_FILE_OFFSET_BITS" redefined
#define _FILE_OFFSET_BITS 64

Quoted 6 lines

In file included from /usr/include/limits.h:37:0,

                 from xdiff/xutils.c:23:

/usr/include/sys/feature_tests.h:231:0: note: this is the location of the previous definition
#define _FILE_OFFSET_BITS 32

make sure git-compat-util.h is the first header (through xinclude.h)

Thanks, this looks good to me. I fixed the system headers in xinclude.h, but didn't think to check for individual C files including them.

I did a quick grep for similar cases, and didn't find any that I think would be problematic. There were a few cleanups, below.

There are still some other system includes, but they are mostly one-offs that we wouldn't expect git-compat-util to cover (e.g., threading stuff in thread-utils.[ch], openssl stuff in hash.h). So I think with your patch, plus the patches below, there's nothing left to clean up.

[1/2]: verify-tag: drop signal.h include
[2/2]: wt-status.h: drop stdio.h include

 builtin/verify-commit.c | 1 -
 builtin/verify-tag.c    | 1 -
 wt-status.h             | 1 -
 3 files changed, 3 deletions(-)

-Peff