From c4487fab0581980d893b07401bc1d0157b9d88b0 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 6 Sep 2013 23:03:23 -0400 Subject: [PATCH] -Wall -Werror --- build.sh | 4 ++-- shamirssecret.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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, -- 2.39.5