Re: [PATCH] kstrtox: fix compile warnings in test

From: Geert Uytterhoeven
Date: Sat Mar 26 2011 - 13:25:51 EST


On Thu, Mar 24, 2011 at 19:51, Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:
> Fix the following warnings:
>
> ÂCC [M] Âlib/test-kstrtox.o
> lib/test-kstrtox.c: In function 'test_kstrtou64_ok':
> lib/test-kstrtox.c:318: warning: this decimal constant is unsigned only in ISO C90
> Â Â Â Â...
>
> Noticed by Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
>
> Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>

Acked-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

> ---
>
> Âlib/test-kstrtox.c | Â 32 ++++++++++++++++----------------
> Â1 file changed, 16 insertions(+), 16 deletions(-)
>
> --- a/lib/test-kstrtox.c
> +++ b/lib/test-kstrtox.c
> @@ -315,12 +315,12 @@ static void __init test_kstrtou64_ok(void)
> Â Â Â Â Â Â Â Â{"65537", Â Â Â 10, Â Â 65537},
> Â Â Â Â Â Â Â Â{"2147483646", Â10, Â Â 2147483646},
> Â Â Â Â Â Â Â Â{"2147483647", Â10, Â Â 2147483647},
> - Â Â Â Â Â Â Â {"2147483648", Â10, Â Â 2147483648},
> - Â Â Â Â Â Â Â {"2147483649", Â10, Â Â 2147483649},
> - Â Â Â Â Â Â Â {"4294967294", Â10, Â Â 4294967294},
> - Â Â Â Â Â Â Â {"4294967295", Â10, Â Â 4294967295},
> - Â Â Â Â Â Â Â {"4294967296", Â10, Â Â 4294967296},
> - Â Â Â Â Â Â Â {"4294967297", Â10, Â Â 4294967297},
> + Â Â Â Â Â Â Â {"2147483648", Â10, Â Â 2147483648ULL},
> + Â Â Â Â Â Â Â {"2147483649", Â10, Â Â 2147483649ULL},
> + Â Â Â Â Â Â Â {"4294967294", Â10, Â Â 4294967294ULL},
> + Â Â Â Â Â Â Â {"4294967295", Â10, Â Â 4294967295ULL},
> + Â Â Â Â Â Â Â {"4294967296", Â10, Â Â 4294967296ULL},
> + Â Â Â Â Â Â Â {"4294967297", Â10, Â Â 4294967297ULL},
> Â Â Â Â Â Â Â Â{"9223372036854775806", 10, Â Â 9223372036854775806ULL},
> Â Â Â Â Â Â Â Â{"9223372036854775807", 10, Â Â 9223372036854775807ULL},
> Â Â Â Â Â Â Â Â{"9223372036854775808", 10, Â Â 9223372036854775808ULL},
> @@ -369,12 +369,12 @@ static void __init test_kstrtos64_ok(void)
> Â Â Â Â Â Â Â Â{"65537", Â Â Â 10, Â Â 65537},
> Â Â Â Â Â Â Â Â{"2147483646", Â10, Â Â 2147483646},
> Â Â Â Â Â Â Â Â{"2147483647", Â10, Â Â 2147483647},
> - Â Â Â Â Â Â Â {"2147483648", Â10, Â Â 2147483648},
> - Â Â Â Â Â Â Â {"2147483649", Â10, Â Â 2147483649},
> - Â Â Â Â Â Â Â {"4294967294", Â10, Â Â 4294967294},
> - Â Â Â Â Â Â Â {"4294967295", Â10, Â Â 4294967295},
> - Â Â Â Â Â Â Â {"4294967296", Â10, Â Â 4294967296},
> - Â Â Â Â Â Â Â {"4294967297", Â10, Â Â 4294967297},
> + Â Â Â Â Â Â Â {"2147483648", Â10, Â Â 2147483648LL},
> + Â Â Â Â Â Â Â {"2147483649", Â10, Â Â 2147483649LL},
> + Â Â Â Â Â Â Â {"4294967294", Â10, Â Â 4294967294LL},
> + Â Â Â Â Â Â Â {"4294967295", Â10, Â Â 4294967295LL},
> + Â Â Â Â Â Â Â {"4294967296", Â10, Â Â 4294967296LL},
> + Â Â Â Â Â Â Â {"4294967297", Â10, Â Â 4294967297LL},
> Â Â Â Â Â Â Â Â{"9223372036854775806", 10, Â Â 9223372036854775806LL},
> Â Â Â Â Â Â Â Â{"9223372036854775807", 10, Â Â 9223372036854775807LL},
> Â Â Â Â};
> @@ -418,10 +418,10 @@ static void __init test_kstrtou32_ok(void)
> Â Â Â Â Â Â Â Â{"65537", Â Â Â 10, Â Â 65537},
> Â Â Â Â Â Â Â Â{"2147483646", Â10, Â Â 2147483646},
> Â Â Â Â Â Â Â Â{"2147483647", Â10, Â Â 2147483647},
> - Â Â Â Â Â Â Â {"2147483648", Â10, Â Â 2147483648},
> - Â Â Â Â Â Â Â {"2147483649", Â10, Â Â 2147483649},
> - Â Â Â Â Â Â Â {"4294967294", Â10, Â Â 4294967294},
> - Â Â Â Â Â Â Â {"4294967295", Â10, Â Â 4294967295},
> + Â Â Â Â Â Â Â {"2147483648", Â10, Â Â 2147483648U},
> + Â Â Â Â Â Â Â {"2147483649", Â10, Â Â 2147483649U},
> + Â Â Â Â Â Â Â {"4294967294", Â10, Â Â 4294967294U},
> + Â Â Â Â Â Â Â {"4294967295", Â10, Â Â 4294967295U},
> Â Â Â Â};
> Â Â Â ÂTEST_OK(kstrtou32, u32, "%u", test_u32_ok);
> Â}

Gr{oetje,eeting}s,

            Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
             Â Â -- Linus Torvalds
èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—