{"thread":{"id":"37290","subject":"[PATCH] cache.h: add missing NORETURN on git_die_config*()","startedAt":"2014-08-05T13:57:52Z","lastAt":"2014-08-05T14:09:47Z","messageCount":2,"participants":["Ramsay Jones","Tanay Abhra"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"247272","messageId":"53E0E2E0.2070709@ramsay1.demon.co.uk","threadId":"37290","inReplyTo":null,"subject":"[PATCH] cache.h: add missing NORETURN on git_die_config*()","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-08-05T13:57:52Z","receivedAt":"2014-08-05T13:57:52Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nCommit 3a2a9527 (\"config: add `git_die_config()` to the config-set\nAPI\", 01-08-2014) added git_die_config() and git_die_config_linenr()\nfunctions, but forgot to include the NORETURN attribute in their\ndeclarations. Sparse complains like so:\n\n        SP config.c\n    config.c:1567:6: error: symbol 'git_die_config_linenr' redeclared \\\n        with different type (originally declared at cache.h:1419) \\\n        - different modifiers\n    config.c:1579:6: error: symbol 'git_die_config' redeclared with \\\n        different type (originally declared at cache.h:1418) \\\n        - different modifiers\n\nSuppress the sparse errors by adding NORETURN to the function\ndeclarations in the cache.h header file.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Tanay,\n\nIf you need to re-roll the patches in the 'ta/config-set-1' branch,\ncould you please squash this into the relevant patch. Thanks!\n\nAt present there are no callers outside of config.c (but that will\nchange right!;-), but since three of the four call sights for these\nfunctions appear _before_ the definitions, only a single call could\npossibly benefit from the NORETURN (line 1585).\n\nHTH\n\nATB,\nRamsay Jones\n\n\n cache.h | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 9faea51..d82a5c3 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1415,8 +1415,8 @@ extern int git_config_get_bool(const char *key, int *dest);\n extern int git_config_get_bool_or_int(const char *key, int *is_bool, int *dest);\n extern int git_config_get_maybe_bool(const char *key, int *dest);\n extern int git_config_get_pathname(const char *key, const char **dest);\n-extern void git_die_config(const char *key);\n-extern void git_die_config_linenr(const char *key, const char *filename, int linenr);\n+extern NORETURN void git_die_config(const char *key);\n+extern NORETURN void git_die_config_linenr(const char *key, const char *filename, int linenr);\n \n extern int committer_ident_sufficiently_given(void);\n extern int author_ident_sufficiently_given(void);\n-- \n2.0.0\n"},{"id":"247273","messageId":"53E0E5AB.9050404@gmail.com","threadId":"37290","inReplyTo":"53E0E2E0.2070709@ramsay1.demon.co.uk","subject":"Re: [PATCH] cache.h: add missing NORETURN on git_die_config*()","fromName":"Tanay Abhra","fromEmail":"tanayabh@gmail.com","sentAt":"2014-08-05T14:09:47Z","receivedAt":"2014-08-05T14:09:47Z","isPatch":true,"sender":{"key":"tanayabh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2097229?v=4"},"body":"\n\nOn 8/5/2014 7:27 PM, Ramsay Jones wrote:\n> \n> Commit 3a2a9527 (\"config: add `git_die_config()` to the config-set\n> API\", 01-08-2014) added git_die_config() and git_die_config_linenr()\n> functions, but forgot to include the NORETURN attribute in their\n> declarations. Sparse complains like so:\n> \n>         SP config.c\n>     config.c:1567:6: error: symbol 'git_die_config_linenr' redeclared \\\n>         with different type (originally declared at cache.h:1419) \\\n>         - different modifiers\n>     config.c:1579:6: error: symbol 'git_die_config' redeclared with \\\n>         different type (originally declared at cache.h:1418) \\\n>         - different modifiers\n> \n> Suppress the sparse errors by adding NORETURN to the function\n> declarations in the cache.h header file.\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n> \n> Hi Tanay,\n> \n> If you need to re-roll the patches in the 'ta/config-set-1' branch,\n> could you please squash this into the relevant patch. Thanks!\n>\n\nSorry, my bad. I will squash it in the relevant patch for my next re roll.\n\nThanks,\nTanay Abhra.\n"}]}