summaryrefslogtreecommitdiff
path: root/tests/utiltest.c
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2015-06-08 10:24:08 +0200
committerMichal Privoznik <mprivozn@redhat.com>2015-06-08 12:54:32 +0200
commitceb46a662dcca71e46cf67247bfa18cb3ae240d3 (patch)
tree3be5f5bd1383325f8439c3f94d278d59deeae1d6 /tests/utiltest.c
parent5ceb34eea08f5bd6006809d0912eaf74312c67dc (diff)
downloadlibvirt-ceb46a662dcca71e46cf67247bfa18cb3ae240d3.tar.gz
utiltest: Use int8_t instead of char.
Not every architecture out there has 'char' signed by default. For instance, my arm box has it unsigned by default: $ gcc -dM -E - < /dev/null | grep __CHAR_UNSIGNED__ #define __CHAR_UNSIGNED__ 1 Therefore, after 65c61e50 the test if failing for me. Problem is, we are trying to assign couple of negative values into char assuming some will overflow and some don't. That can't be the case if 'char' is unsigned by default. Lets use more explicit types instead: int8_t and uint8_t where is no ambiguity. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Diffstat (limited to 'tests/utiltest.c')
-rw-r--r--tests/utiltest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/utiltest.c b/tests/utiltest.c
index 3a1f8ebbe9..98c689d07c 100644
--- a/tests/utiltest.c
+++ b/tests/utiltest.c
@@ -184,8 +184,8 @@ static int
testOverflowCheckMacro(const void *data ATTRIBUTE_UNUSED)
{
long long tmp;
- unsigned char luchar;
- char lchar;
+ uint8_t luchar;
+ int8_t lchar;
TEST_OVERFLOW(luchar, 254, false);
TEST_OVERFLOW(luchar, 255, false);