[systemd-devel] [PATCH 5/5] test-strv : Fix shadowing compilation warning

Lennart Poettering lennart at poettering.net
Mon Oct 20 09:49:11 PDT 2014


On Fri, 17.10.14 00:43, philippedeswert at gmail.com (philippedeswert at gmail.com) wrote:

> From: Philippe De Swert <philippedeswert at gmail.com>
> 
> Remove the following warning during compilation:
> src/test/test-strv.c: In function ‘test_strv_quote_unquote’:
> src/test/test-strv.c:140:56: warning: declaration of ‘split’ shadows a global declaration [-Wshadow]
> In file included from src/test/test-strv.c:25:0:
> ./src/shared/util.h:248:13: warning: shadowed declaration is here [-Wshadow]
> ---
>  src/test/test-strv.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/test/test-strv.c b/src/test/test-strv.c
> index bbfe306..ee19f29 100644
> --- a/src/test/test-strv.c
> +++ b/src/test/test-strv.c
> @@ -137,13 +137,13 @@ static void test_strv_join(void) {
>          assert_se(streq(t, ""));
>  }
>  
> -static void test_strv_quote_unquote(const char* const *split, const char *quoted) {
> +static void test_strv_quote_unquote(const char* const *splitted,
> const char *quoted) {

Yuck! it's "split, split, split", not "split, splitted, splitted" in
proper english!

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list