* [PATCH] cache.h: add missing NORETURN on git_die_config*()
@ 2014-08-05 13:57 Ramsay Jones
2014-08-05 14:09 ` Tanay Abhra
0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2014-08-05 13:57 UTC (permalink / raw)
To: Tanay Abhra; +Cc: Matthieu Moy, Junio C Hamano, GIT Mailing-list
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 <ramsay@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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cache.h: add missing NORETURN on git_die_config*()
2014-08-05 13:57 [PATCH] cache.h: add missing NORETURN on git_die_config*() Ramsay Jones
@ 2014-08-05 14:09 ` Tanay Abhra
0 siblings, 0 replies; 2+ messages in thread
From: Tanay Abhra @ 2014-08-05 14:09 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Matthieu Moy, Junio C Hamano, GIT Mailing-list
On 8/5/2014 7:27 PM, Ramsay Jones wrote:
>
> 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 <ramsay@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!
>
Sorry, my bad. I will squash it in the relevant patch for my next re roll.
Thanks,
Tanay Abhra.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-05 14:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-05 13:57 [PATCH] cache.h: add missing NORETURN on git_die_config*() Ramsay Jones
2014-08-05 14:09 ` Tanay Abhra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).