Commit 3a2a9527 ("config: add `git_die_config()` to the config-set
API", 01-08-2014) added git_die_config() and git_die_config_linenr()
functions, but forgot to include the NORETURN attribute in their
declarations. Sparse complains like so:

        SP config.c
    config.c:1567:6: error: symbol 'git_die_config_linenr' redeclared \
        with different type (originally declared at cache.h:1419) \
        - different modifiers
    config.c:1579:6: error: symbol 'git_die_config' redeclared with \
        different type (originally declared at cache.h:1418) \
        - different modifiers

Suppress the sparse errors by adding NORETURN to the function
declarations in the cache.h header file.

Signed-off-by: Ramsay Jones <ram...@ramsay1.demon.co.uk>
---

Hi Tanay,

If you need to re-roll the patches in the 'ta/config-set-1' branch,
could you please squash this into the relevant patch. Thanks!

At present there are no callers outside of config.c (but that will
change right!;-), but since three of the four call sights for these
functions appear _before_ the definitions, only a single call could
possibly benefit from the NORETURN (line 1585).

HTH

ATB,
Ramsay Jones


 cache.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cache.h b/cache.h
index 9faea51..d82a5c3 100644
--- a/cache.h
+++ b/cache.h
@@ -1415,8 +1415,8 @@ extern int git_config_get_bool(const char *key, int 
*dest);
 extern int git_config_get_bool_or_int(const char *key, int *is_bool, int 
*dest);
 extern int git_config_get_maybe_bool(const char *key, int *dest);
 extern int git_config_get_pathname(const char *key, const char **dest);
-extern void git_die_config(const char *key);
-extern void git_die_config_linenr(const char *key, const char *filename, int 
linenr);
+extern NORETURN void git_die_config(const char *key);
+extern NORETURN void git_die_config_linenr(const char *key, const char 
*filename, int linenr);
 
 extern int committer_ident_sufficiently_given(void);
 extern int author_ident_sufficiently_given(void);
-- 
2.0.0
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to