提交 c7ca02e6 编写于 作者: E Eric Blake

build: avoid compiler warning on 32-bit platform

On a 32-bit platform:

virstringtest.c: In function 'mymain':
virstringtest.c:673: warning: this decimal constant is unsigned only in ISO C90

I already had a comment in the file about the 64-bit counterpart;
the easiest fix was to make both sites use the standardized macro
that is guaranteed to work.

* tests/virstringtest.c (mymain): Minimum signed integers are a pain.
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 23f38f88
......@@ -670,7 +670,7 @@ mymain(void)
-1LL, 0, 18446744073709551615ULL, 0);
TEST_STRTOL("-2147483647", NULL, -2147483647, 0, 2147483649U, 0,
-2147483647LL, 0, 18446744071562067969ULL, 0);
TEST_STRTOL("-2147483648", NULL, -2147483648, 0, 2147483648U, 0,
TEST_STRTOL("-2147483648", NULL, INT32_MIN, 0, 2147483648U, 0,
-2147483648LL, 0, 18446744071562067968ULL, 0);
TEST_STRTOL("-2147483649", NULL, 0, -1, 2147483647U, 0,
-2147483649LL, 0, 18446744071562067967ULL, 0);
......@@ -680,10 +680,8 @@ mymain(void)
-4294967296LL, 0, 18446744069414584320ULL, 0);
TEST_STRTOL("-9223372036854775807", NULL, 0, -1, 0U, -1,
-9223372036854775807LL, 0, 9223372036854775809ULL, 0);
/* Bah, stupid gcc warning about -9223372036854775808LL being an
* unrepresentable integer constant */
TEST_STRTOL("-9223372036854775808", NULL, 0, -1, 0U, -1,
0x8000000000000000LL, 0, 9223372036854775808ULL, 0);
INT64_MIN, 0, 9223372036854775808ULL, 0);
TEST_STRTOL("-9223372036854775809", NULL, 0, -1, 0U, -1,
0LL, -1, 9223372036854775807ULL, 0);
TEST_STRTOL("-18446744073709551615", NULL, 0, -1, 0U, -1,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册