All of lore.kernel.org
 help / color / mirror / Atom feed
From: Beat Bolli <dev+git@drbeat.li>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Beat Bolli <dev+git@drbeat.li>
Subject: [PATCH 1/2] packfile: drop a repeated enum declaration
Date: Tue, 24 Jul 2018 23:52:22 +0200	[thread overview]
Message-ID: <20180724215223.27516-2-dev+git@drbeat.li> (raw)
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


  reply	other threads:[~2018-07-24 21:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 21:52 [PATCH 0/2] Pedantic fixes for Apple clang Beat Bolli
2018-07-24 21:52 ` Beat Bolli [this message]
2018-07-24 21:57   ` [PATCH 1/2] packfile: drop a repeated enum declaration Jonathan Nieder
2018-07-24 21:52 ` [PATCH 2/2] remote-odb: un-inline function remote_odb_reinit Beat Bolli
2018-07-24 21:59   ` Jonathan Nieder
2018-07-24 22:03     ` Beat Bolli
2018-07-25  7:29       ` Christian Couder
2018-07-25 21:16         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180724215223.27516-2-dev+git@drbeat.li \
    --to=dev+git@drbeat.li \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.