ctype.c: Fix a sparse warning
PATCH 1/1 ctype.c: Fix a sparse warning
In particular, sparse complains as follows:
SP ctype.c
ctype.c:30:12: warning: symbol 'tolower_trans_tbl' was not declared.\
Should it be static?
An appropriate extern declaration for the 'tolower_trans_tbl' symbol is included in the "cache.h" header file. In order to suppress the warning, therefore, we could replace the "git-compat-util.h" header inclusion with "cache.h", since "cache.h" includes "git-compat-util.h" in turn. Here, however, we choose to move the extern declaration for 'tolower_trans_tbl' into "git-compat-util.h", alongside the other extern declaration from ctype.c for 'sane_ctype'.
---
Hi Junio,
Could you please squash this, or something like it, into commit 0f871cf5 ("grep: use static trans-case table",28-02-2012).
Thanks!
ATB,
Ramsay Jones
cache.h | 3 --- git-compat-util.h | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-)
cache.h +0 -3
@@ -1285,7 +1285,4 @@ extern struct startup_info *startup_info;/* builtin/merge.c */ int checkout_fast_forward (const unsigned char *from,const unsigned char *to); -/* in ctype.c, for kwset users */ -extern const char tolower_trans_tbl[256 ]; -#endif /* CACHE_H */
git-compat-util.h +3 -0
@@ -457,6 +457,9 @@ static inline int has_extension(const char *filename, const char *ext)return len > extlen && !memcmp (filename + len - extlen, ext, extlen); } +/* in ctype.c, for kwset users */ +extern const char tolower_trans_tbl[256 ]; +/* Sane ctype - no locale, and works with signed chars */ #undef isascii#undef isspace
Signature · 1 line
1.7.9