{"thread":{"id":"48507","subject":"[PATCH] refspec.h: reinstate 'extern' to fix sparse warning","startedAt":"2018-05-16T21:35:43Z","lastAt":"2018-05-16T21:52:24Z","messageCount":4,"participants":["Ramsay Jones","Brandon Williams","Stefan Beller","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"347828","messageId":"29f60a43-9c95-512a-ef85-558906a08ed0@ramsayjones.plus.com","threadId":"48507","inReplyTo":null,"subject":"[PATCH] refspec.h: reinstate 'extern' to fix sparse warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2018-05-16T21:35:37Z","receivedAt":"2018-05-16T21:35:43Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi Brandon,\n\nIf you need to re-roll your 'bw/refspec-api' branch, could you please\nsquash this, or the equivalent change before the 'struct refname' to\n'struct refname_item' name change, into the relevant patch. (which\nwould be patch #1, commit 8999381ed).\n\nThis patch was built on top of 'pu', but as I said above, patch #1\nis where the original 'extern' keyword was dropped. (see first hunk\nof the diff to 'remote.h').\n\nThanks!\n\nATB,\nRamsay Jones\n\n refspec.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/refspec.h b/refspec.h\nindex 374f8ea63..7e1ff94ac 100644\n--- a/refspec.h\n+++ b/refspec.h\n@@ -2,7 +2,7 @@\n #define REFSPEC_H\n \n #define TAG_REFSPEC \"refs/tags/*:refs/tags/*\"\n-const struct refspec_item *tag_refspec;\n+extern const struct refspec_item *tag_refspec;\n \n struct refspec_item {\n \tunsigned force : 1;\n-- \n2.17.0\n"},{"id":"347829","messageId":"20180516214251.GA60301@google.com","threadId":"48507","inReplyTo":"29f60a43-9c95-512a-ef85-558906a08ed0@ramsayjones.plus.com","subject":"Re: [PATCH] refspec.h: reinstate 'extern' to fix sparse warning","fromName":"Brandon Williams","fromEmail":"bmwill@google.com","sentAt":"2018-05-16T21:42:51Z","receivedAt":"2018-05-16T21:42:57Z","isPatch":true,"sender":{"key":"bwilliams.eng@gmail.com","avatar":null},"body":"On 05/16, Ramsay Jones wrote:\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n> \n> Hi Brandon,\n> \n> If you need to re-roll your 'bw/refspec-api' branch, could you please\n> squash this, or the equivalent change before the 'struct refname' to\n> 'struct refname_item' name change, into the relevant patch. (which\n> would be patch #1, commit 8999381ed).\n> \n> This patch was built on top of 'pu', but as I said above, patch #1\n> is where the original 'extern' keyword was dropped. (see first hunk\n> of the diff to 'remote.h').\n\nOf course I'll do that, I'm planning on sending out a v2 by the end of\nthe day and I'll incorporate that.\n\nThough now I'm confused, I thought we were going towards eliminating\nusing the extern keyword? ...of course I guess it means something\n_slightly_ different when using with a variable vs a function :)\n\n> \n> Thanks!\n> \n> ATB,\n> Ramsay Jones\n> \n>  refspec.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/refspec.h b/refspec.h\n> index 374f8ea63..7e1ff94ac 100644\n> --- a/refspec.h\n> +++ b/refspec.h\n> @@ -2,7 +2,7 @@\n>  #define REFSPEC_H\n>  \n>  #define TAG_REFSPEC \"refs/tags/*:refs/tags/*\"\n> -const struct refspec_item *tag_refspec;\n> +extern const struct refspec_item *tag_refspec;\n>  \n>  struct refspec_item {\n>  \tunsigned force : 1;\n> -- \n> 2.17.0\n\n-- \nBrandon Williams\n"},{"id":"347830","messageId":"CAGZ79kbPNJPtcvbgu81y3UYmKsUd6UNNr9kmQ7qjEfB0ZBTJwQ@mail.gmail.com","threadId":"48507","inReplyTo":"20180516214251.GA60301@google.com","subject":"Re: [PATCH] refspec.h: reinstate 'extern' to fix sparse warning","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-16T21:47:00Z","receivedAt":"2018-05-16T21:47:06Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Wed, May 16, 2018 at 2:42 PM, Brandon Williams <bmwill@google.com> wrote:\n> On 05/16, Ramsay Jones wrote:\n>>\n>> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n>> ---\n>>\n>> Hi Brandon,\n>>\n>> If you need to re-roll your 'bw/refspec-api' branch, could you please\n>> squash this, or the equivalent change before the 'struct refname' to\n>> 'struct refname_item' name change, into the relevant patch. (which\n>> would be patch #1, commit 8999381ed).\n>>\n>> This patch was built on top of 'pu', but as I said above, patch #1\n>> is where the original 'extern' keyword was dropped. (see first hunk\n>> of the diff to 'remote.h').\n>\n> Of course I'll do that, I'm planning on sending out a v2 by the end of\n> the day and I'll incorporate that.\n>\n> Though now I'm confused, I thought we were going towards eliminating\n> using the extern keyword? ...of course I guess it means something\n> _slightly_ different when using with a variable vs a function :)\n\nWe're only eliminating it when it is redundant. :-)\n\nFor variables this is not redundant as we need it to tell apart the\ndeclaration and definition of it, so we have to keep it.\n"},{"id":"347831","messageId":"nycvar.QRO.7.76.6.1805162351050.77@tvgsbejvaqbjf.bet","threadId":"48507","inReplyTo":"CAGZ79kbPNJPtcvbgu81y3UYmKsUd6UNNr9kmQ7qjEfB0ZBTJwQ@mail.gmail.com","subject":"Re: [PATCH] refspec.h: reinstate 'extern' to fix sparse warning","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-05-16T21:52:13Z","receivedAt":"2018-05-16T21:52:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"On Wed, 16 May 2018, Stefan Beller wrote:\n\n> On Wed, May 16, 2018 at 2:42 PM, Brandon Williams <bmwill@google.com> wrote:\n>\n> > Though now I'm confused, I thought we were going towards eliminating\n> > using the extern keyword? ...of course I guess it means something\n> > _slightly_ different when using with a variable vs a function :)\n> \n> We're only eliminating it when it is redundant. :-)\n> \n> For variables this is not redundant as we need it to tell apart the\n> declaration and definition of it, so we have to keep it.\n\nOtherwise we will end up with the variable *defined* for every file that\nincludes that header. And of course those different versions of the same\nvariable would have possibly different values...\n"}]}