]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: avoid compiler warning on 32-bit platform
authorEric Blake <eblake@redhat.com>
Fri, 30 May 2014 22:30:07 +0000 (16:30 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 30 May 2014 22:37:53 +0000 (16:37 -0600)
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: Eric Blake <eblake@redhat.com>
tests/virstringtest.c

index 1e330f9593f1160cb13d92d629dbcd3a6af57a36..96c3784a588b3a0ebe5e86d7615336fd634d9702 100644 (file)
@@ -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,