aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2019-03-14 14:46:10 -0700
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2019-03-18 16:17:52 -0700
commit6667d00ac36170b523e73d588f4b0ec7010d2f76 (patch)
treedc812a051ac7b9aaa8f6b3c42acb22efee86fe2a
parentfecc42ddd183ce2c2f8c1ff694dcb367ef9a7333 (diff)
downloadfido2-ctap-gadget-6667d00ac36170b523e73d588f4b0ec7010d2f76.tar.gz
Add -Wall -Werror and clean up the errors they report
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--Makefile.am2
-rw-r--r--fido.c4
-rw-r--r--hidgd.c4
3 files changed, 6 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index 8285148..8372f19 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,3 +3,5 @@ bin_PROGRAMS=fido hidgd
fido_SOURCES=fido.c
hidgd_SOURCES=hidgd.c u2f.h u2f_hid.h
+
+AM_CFLAGS=-Wall -Werror
diff --git a/fido.c b/fido.c
index 632e66f..17603e5 100644
--- a/fido.c
+++ b/fido.c
@@ -34,11 +34,11 @@ unsigned char report_desc[] = {
};
int
-main(int argc, void *argv[])
+main(int argc, char *argv[])
{
int fd;
- printf("size is %d\n", sizeof(report_desc));
+ printf("size is %ld\n", sizeof(report_desc));
if (argc != 2)
exit(0);
printf("writing file\n");
diff --git a/hidgd.c b/hidgd.c
index 0463d61..94e5a11 100644
--- a/hidgd.c
+++ b/hidgd.c
@@ -47,7 +47,7 @@ static void process_init(U2FHID_FRAME *frame)
int count;
if (MSG_LEN(*frame) != sizeof(U2FHID_INIT_REQ)) {
- fprintf(stderr, "INIT message wrong length %d != %d\n",
+ fprintf(stderr, "INIT message wrong length %d != %ld\n",
MSG_LEN(*frame),
sizeof(U2FHID_INIT_REQ));
process_error(frame, ERR_INVALID_LEN);
@@ -63,7 +63,7 @@ static void process_init(U2FHID_FRAME *frame)
reply->init.cmd = U2FHID_INIT;
reply->init.bcnth = 0;
reply->init.bcntl = 17;
- printf("setting reply size to %d\n", sizeof(*resp));
+ printf("setting reply size to %ld\n", sizeof(*resp));
memcpy(resp->nonce, req->nonce, sizeof(req->nonce));
resp->cid = 1;
resp->versionInterface = U2FHID_IF_VERSION;