From: Matt Corallo Date: Sat, 7 Sep 2013 03:03:23 +0000 (-0400) Subject: -Wall -Werror X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=c4487fab0581980d893b07401bc1d0157b9d88b0;p=shamirs -Wall -Werror --- diff --git a/build.sh b/build.sh index b473a52..47c76de 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/bin/sh -gcc shamirssecret.c -O2 -std=c99 -DTEST -o shamirssecret && ./shamirssecret && -gcc shamirssecret.c -O2 -std=c99 -o shamirssecret +$CC shamirssecret.c $CFLAGS -Wall -Werror -O2 -std=c99 -DTEST -o shamirssecret && ./shamirssecret && +$CC shamirssecret.c $CFLAGS -Wall -Werror -O2 -std=c99 -o shamirssecret diff --git a/shamirssecret.c b/shamirssecret.c index 80f835c..277ecb1 100644 --- a/shamirssecret.c +++ b/shamirssecret.c @@ -16,6 +16,7 @@ */ #define P 256 +#ifndef TEST static uint8_t field_add(uint8_t a, uint8_t b) { return a ^ b; } @@ -27,6 +28,7 @@ static uint8_t field_sub(uint8_t a, uint8_t b) { static uint8_t field_neg(uint8_t a) { return field_sub(0, a); } +#endif static const uint8_t exp[P] = { 0x01, 0x03, 0x05, 0x0f, 0x11, 0x33, 0x55, 0xff, 0x1a, 0x2e, 0x72, 0x96, 0xa1, 0xf8, 0x13, 0x35,