2016-09-03 Niels Möller <nisse@lysator.liu.se>
+ * testsuite/testutils.h (US): New macro, for unsigned string
+ literals.
+ (LDATA): Use the US macro, to eliminate pointer signedness
+ warnings.
+
* testsuite/rsa-encrypt-test.c (test_main): Fix pointer
signednesss warning.
test_ecc_mul_h (unsigned curve, unsigned n, const mp_limb_t *p);
#endif /* WITH_HOGWEED */
+
+/* String literal of type unsigned char. The GNUC version is safer. */
+#if __GNUC__
+#define US(s) ({ static const unsigned char us_s[] = s; us_s; })
+#else
+#define US(s) ((const uint8_t *) (s))
+#endif
/* LDATA needs to handle NUL characters. */
#define LLENGTH(x) (sizeof(x) - 1)
-#define LDATA(x) LLENGTH(x), x
+#define LDATA(x) LLENGTH(x), US(x)
#define LDUP(x) strlen(x), strdup(x)
#define SHEX(x) (tstring_hex(x))