Skip to content

Commit

Permalink
packfile: ensure that enum object_type is defined
Browse files Browse the repository at this point in the history
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 and include cache.h
instead to make sure the enum is defined.

Helped-by: Jonathan Nieder <[email protected]>
Signed-off-by: Beat Bolli <[email protected]>
Reviewed-by: Jonathan Nieder <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
bbolli authored and gitster committed Jul 26, 2018
1 parent b7bd948 commit b42f98a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packfile.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef PACKFILE_H
#define PACKFILE_H

#include "cache.h"
#include "oidset.h"

/* 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
Expand Down

0 comments on commit b42f98a

Please sign in to comment.