#include <ecoli_malloc.h>
#include <stdlib.h>
+#include <stdint.h>
#include <string.h>
#include <errno.h>
ec_free_func(ptr);
ptr = NULL;
- ptr = ec_calloc(2, (size_t)-1);
+ /* here we use atoll() instead of a constant because we want to
+ * prevent the compiler to check the overflow at compilation
+ * time */
+ ptr = ec_calloc(2, atoll("0xffffffffffffffff"));
EC_TEST_CHECK(ptr == NULL, "bad overflow check in ec_calloc\n");
return testres;
k1 = 0;
switch(len & 3) {
- case 3: k1 ^= tail[2] << 16;
- case 2: k1 ^= tail[1] << 8;
+ case 3: k1 ^= tail[2] << 16; /* fallthrough */
+ case 2: k1 ^= tail[1] << 8; /* fallthrough */
case 1: k1 ^= tail[0];
h1 = ec_murmurhash3_add32(h1, k1);
};