{"thread":{"id":"48950","subject":"[PATCH 0/2] Pedantic fixes for Apple clang","startedAt":"2018-07-24T21:52:36Z","lastAt":"2018-07-25T21:17:04Z","messageCount":8,"participants":["Beat Bolli","Jonathan Nieder","Christian Couder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"353533","messageId":"20180724215223.27516-1-dev+git@drbeat.li","threadId":"48950","inReplyTo":null,"subject":"[PATCH 0/2] Pedantic fixes for Apple clang","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2018-07-24T21:52:21Z","receivedAt":"2018-07-24T21:52:36Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"Following up on my previous series bb/pedantic for gcc, here are two\nfixes for pedantic compilation under MacOS 10.13.6 (High Sierra) with\nthe command line tools of Xcode Version 9.4.1 (9F2000).\n\nBeat Bolli (2):\n  packfile: drop a repeated enum declaration\n  remote-odb: un-inline function remote_odb_reinit\n\n packfile.h   | 1 -\n remote-odb.c | 2 +-\n 2 files changed, 1 insertion(+), 2 deletions(-)\n\n-- \n2.18.0\n\n"},{"id":"353534","messageId":"20180724215223.27516-3-dev+git@drbeat.li","threadId":"48950","inReplyTo":"20180724215223.27516-1-dev+git@drbeat.li","subject":"[PATCH 2/2] remote-odb: un-inline function remote_odb_reinit","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2018-07-24T21:52:23Z","receivedAt":"2018-07-24T21:52:37Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"When compiling under Apple LLVM version 9.1.0 (clang-902.0.39.2) with\n\"make DEVELOPER=1 DEVOPTS=pedantic\", the compiler says\n\n    remote-odb.c:87:2: error: static function 'remote_odb_do_init' is\n    used in an inline function with external linkage\n    [-Werror,-Wstatic-in-inline]\n\nRemove the inline specifier that would only make sense if\nremote_odb_reinit were defined in the header file. Moving it into the\nheader is not possible because the called function remote_odb_do_init is\nstatic and thus not visible from the includers of the header.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n remote-odb.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/remote-odb.c b/remote-odb.c\nindex 847a86505778..49cf8e30aa92 100644\n--- a/remote-odb.c\n+++ b/remote-odb.c\n@@ -82,7 +82,7 @@ static inline void remote_odb_init(void)\n \tremote_odb_do_init(0);\n }\n \n-inline void remote_odb_reinit(void)\n+void remote_odb_reinit(void)\n {\n \tremote_odb_do_init(1);\n }\n-- \n2.18.0\n\n"},{"id":"353535","messageId":"20180724215223.27516-2-dev+git@drbeat.li","threadId":"48950","inReplyTo":"20180724215223.27516-1-dev+git@drbeat.li","subject":"[PATCH 1/2] packfile: drop a repeated enum declaration","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2018-07-24T21:52:22Z","receivedAt":"2018-07-24T21:52:39Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"When compiling under Apple LLVM version 9.1.0 (clang-902.0.39.2) with\n\"make DEVELOPER=1 DEVOPTS=pedantic\", the compiler says\n\n    error: redeclaration of already-defined enum 'object_type' is a GNU\n    extension [-Werror,-Wgnu-redeclared-enum]\n\nAccording to https://en.cppreference.com/w/c/language/declarations\n(section \"Redeclaration\"), a repeated declaration after the definition\nis only legal for structs and unions, but not for enums.\n\nDrop the belated declaration of enum object_type. It seems that each\nincluder of packfile.h includes the definition of the enum before\nincluding packfile.h.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n packfile.h | 1 -\n 1 file changed, 1 deletion(-)\n\ndiff --git a/packfile.h b/packfile.h\nindex 51383774ec72..9b6198c4c7e0 100644\n--- a/packfile.h\n+++ b/packfile.h\n@@ -6,7 +6,6 @@\n /* in object-store.h */\n struct packed_git;\n struct object_info;\n-enum object_type;\n \n /*\n  * Generate the filename to be used for a pack file with checksum \"sha1\" and\n-- \n2.18.0\n\n"},{"id":"353536","messageId":"20180724215736.GC136514@aiede.svl.corp.google.com","threadId":"48950","inReplyTo":"20180724215223.27516-2-dev+git@drbeat.li","subject":"Re: [PATCH 1/2] packfile: drop a repeated enum declaration","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2018-07-24T21:57:36Z","receivedAt":"2018-07-24T21:57:40Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nBeat Bolli wrote:\n\n> --- a/packfile.h\n> +++ b/packfile.h\n> @@ -6,7 +6,6 @@\n>  /* in object-store.h */\n>  struct packed_git;\n>  struct object_info;\n> -enum object_type;\n>  \n>  /*\n>   * Generate the filename to be used for a pack file with checksum \"sha1\" and\n\nGood catch.  This means packfile.h should #include \"cache.h\" ---\notherwise, it is not usable in a file that does\n\n\t#include \"git-compat-util.h\"\n\t#include \"packfile.h\"\n\nThanks and hope that helps,\nJonathan\n"},{"id":"353538","messageId":"20180724215953.GD136514@aiede.svl.corp.google.com","threadId":"48950","inReplyTo":"20180724215223.27516-3-dev+git@drbeat.li","subject":"Re: [PATCH 2/2] remote-odb: un-inline function remote_odb_reinit","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2018-07-24T21:59:53Z","receivedAt":"2018-07-24T21:59:58Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nBeat Bolli wrote:\n\n> When compiling under Apple LLVM version 9.1.0 (clang-902.0.39.2) with\n> \"make DEVELOPER=1 DEVOPTS=pedantic\", the compiler says\n>\n>     remote-odb.c:87:2: error: static function 'remote_odb_do_init' is\n>     used in an inline function with external linkage\n>     [-Werror,-Wstatic-in-inline]\n>\n> Remove the inline specifier that would only make sense if\n> remote_odb_reinit were defined in the header file. Moving it into the\n> header is not possible because the called function remote_odb_do_init is\n> static and thus not visible from the includers of the header.\n>\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  remote-odb.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n\nWhat branch does this apply to?\n\n[...]\n> --- a/remote-odb.c\n> +++ b/remote-odb.c\n> @@ -82,7 +82,7 @@ static inline void remote_odb_init(void)\n>  \tremote_odb_do_init(0);\n>  }\n>  \n> -inline void remote_odb_reinit(void)\n> +void remote_odb_reinit(void)\n\nThis looks like an oversight in\nhttps://public-inbox.org/git/20180713174959.16748-6-chriscool@tuxfamily.org/:\nthere isn't any reason for this function to be inline.\n\nChristian, can you squash it in on your next reroll?\n\nThanks,\nJonathan\n"},{"id":"353539","messageId":"cf9889ba-89c5-dc97-d888-aa42aa9dee68@drbeat.li","threadId":"48950","inReplyTo":"20180724215953.GD136514@aiede.svl.corp.google.com","subject":"Re: [PATCH 2/2] remote-odb: un-inline function remote_odb_reinit","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2018-07-24T22:03:20Z","receivedAt":"2018-07-24T22:03:31Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"Hi Jonathan\n\nOn 24.07.18 23:59, Jonathan Nieder wrote:\n> Hi,\n> \n> Beat Bolli wrote:\n> \n>> When compiling under Apple LLVM version 9.1.0 (clang-902.0.39.2) with\n>> \"make DEVELOPER=1 DEVOPTS=pedantic\", the compiler says\n>>\n>>     remote-odb.c:87:2: error: static function 'remote_odb_do_init' is\n>>     used in an inline function with external linkage\n>>     [-Werror,-Wstatic-in-inline]\n>>\n>> Remove the inline specifier that would only make sense if\n>> remote_odb_reinit were defined in the header file. Moving it into the\n>> header is not possible because the called function remote_odb_do_init is\n>> static and thus not visible from the includers of the header.\n>>\n>> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n>> ---\n>>  remote-odb.c | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> What branch does this apply to?\n\nTo pu as of today.\n\n> [...]\n>> --- a/remote-odb.c\n>> +++ b/remote-odb.c\n>> @@ -82,7 +82,7 @@ static inline void remote_odb_init(void)\n>>  \tremote_odb_do_init(0);\n>>  }\n>>  \n>> -inline void remote_odb_reinit(void)\n>> +void remote_odb_reinit(void)\n> \n> This looks like an oversight in\n> https://public-inbox.org/git/20180713174959.16748-6-chriscool@tuxfamily.org/:\n> there isn't any reason for this function to be inline.\n> \n> Christian, can you squash it in on your next reroll?\n\nThat would probably make sense. I didn't check how mature the topics\nwere that caused errors.\n\nBeat\n"},{"id":"353547","messageId":"CAP8UFD2PxA4s=Gb-6paUAdWpmqMWpis3mn0Zz9nzqQhHt1EEBg@mail.gmail.com","threadId":"48950","inReplyTo":"cf9889ba-89c5-dc97-d888-aa42aa9dee68@drbeat.li","subject":"Re: [PATCH 2/2] remote-odb: un-inline function remote_odb_reinit","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2018-07-25T07:29:06Z","receivedAt":"2018-07-25T07:29:09Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi,\n\nOn Wed, Jul 25, 2018 at 12:03 AM, Beat Bolli <dev+git@drbeat.li> wrote:\n>\n> On 24.07.18 23:59, Jonathan Nieder wrote:\n>>\n>> Beat Bolli wrote:\n\n>>> -inline void remote_odb_reinit(void)\n>>> +void remote_odb_reinit(void)\n>>\n>> This looks like an oversight in\n>> https://public-inbox.org/git/20180713174959.16748-6-chriscool@tuxfamily.org/:\n>> there isn't any reason for this function to be inline.\n>>\n>> Christian, can you squash it in on your next reroll?\n>\n> That would probably make sense. I didn't check how mature the topics\n> were that caused errors.\n\nOk, it is in the next version I will send.\n\nThanks,\nChristian.\n"},{"id":"353593","messageId":"xmqqmuuft3qs.fsf@gitster-ct.c.googlers.com","threadId":"48950","inReplyTo":"CAP8UFD2PxA4s=Gb-6paUAdWpmqMWpis3mn0Zz9nzqQhHt1EEBg@mail.gmail.com","subject":"Re: [PATCH 2/2] remote-odb: un-inline function remote_odb_reinit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-25T21:16:59Z","receivedAt":"2018-07-25T21:17:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> Hi,\n>\n> On Wed, Jul 25, 2018 at 12:03 AM, Beat Bolli <dev+git@drbeat.li> wrote:\n>>\n>> On 24.07.18 23:59, Jonathan Nieder wrote:\n>>>\n>>> Beat Bolli wrote:\n>\n>>>> -inline void remote_odb_reinit(void)\n>>>> +void remote_odb_reinit(void)\n>>>\n>>> This looks like an oversight in\n>>> https://public-inbox.org/git/20180713174959.16748-6-chriscool@tuxfamily.org/:\n>>> there isn't any reason for this function to be inline.\n>>>\n>>> Christian, can you squash it in on your next reroll?\n>>\n>> That would probably make sense. I didn't check how mature the topics\n>> were that caused errors.\n>\n> Ok, it is in the next version I will send.\n\nOK, then I'll ignore this one for now.\n"}]}