[PATCH 1/2] packfile: drop a repeated enum declaration
- From
Beat Bolli <dev+git@drbeat.li>
- Date
- Jul 24, 2018, 21:52 UTC
- Message-ID
- <20180724215223.27516-2-dev+git@drbeat.li>
- In-Reply-To
- <20180724215223.27516-1-dev+git@drbeat.li>
When compiling under Apple LLVM version 9.1.0 (clang-902.0.39.2) with "make DEVELOPER=1 DEVOPTS=pedantic", the compiler says
error: redeclaration of already-defined enum 'object_type' is a GNU
extension [-Werror,-Wgnu-redeclared-enum]According to https://en.cppreference.com/w/c/language/declarations (section "Redeclaration"), a repeated declaration after the definition is only legal for structs and unions, but not for enums.
Drop the belated declaration of enum object_type. It seems that each includer of packfile.h includes the definition of the enum before including packfile.h.
Signed-off-by: Beat Bolli <dev+git@drbeat.li> --- packfile.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/packfile.h b/packfile.h index 51383774ec72..9b6198c4c7e0 100644 --- a/packfile.h +++ b/packfile.h @@ -6,7 +6,6 @@ /* in object-store.h */ struct packed_git; struct object_info; -enum object_type; /* * Generate the filename to be used for a pack file with checksum "sha1" and
-- 2.18.0