diff options
author | Patrick Steinhardt <ps@pks.im> | 2018-08-10 19:23:00 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2018-09-21 12:11:06 +0200 |
commit | b9affa329a18d076094442d5af30e294c8fe8722 (patch) | |
tree | d33759cabae098e00fc4525a8d81bd4435c5dd5d /src/config_parse.c | |
parent | 0b9c68b1366e7ef458b4932f066c487498e6c79f (diff) | |
download | libgit2-b9affa329a18d076094442d5af30e294c8fe8722.tar.gz |
config_parse: avoid unused static declared values
The variables `git_config_escaped` and `git_config_escapes` are both
defined as static const character pointers in "config_parse.h". In case
where "config_parse.h" is included but those two variables are not being
used, the compiler will thus complain about defined but unused
variables. Fix this by declaring them as external and moving the actual
initialization to the C file.
Note that it is not possible to simply make this a #define, as we are
indexing into those arrays.
Diffstat (limited to 'src/config_parse.c')
-rw-r--r-- | src/config_parse.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/config_parse.c b/src/config_parse.c index 282aabe17..6e85bbe0d 100644 --- a/src/config_parse.c +++ b/src/config_parse.c @@ -11,6 +11,9 @@ #include <ctype.h> +const char *git_config_escapes = "ntb\"\\"; +const char *git_config_escaped = "\n\t\b\"\\"; + static void set_parse_error(git_config_parser *reader, int col, const char *error_str) { giterr_set(GITERR_CONFIG, "failed to parse config file: %s (in %s:%"PRIuZ", column %d)", |