Fix warnings reported by -Wpedantic

Previously CI hasn't been running with -Wpedantic (using autoconf), so
these haven't been reported previously.

- replace BUILD_ASSERT with static_assert()
- don't use %m GNU extension for printf
- don't use arithmetic on void*
- remove unused variables

Change-Id: I97d1acc908f06773b8b1ee95bfee80760fdc7a63
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
diff --git a/serial.c b/serial.c
index 47d250e..e2a2df2 100644
--- a/serial.c
+++ b/serial.c
@@ -317,7 +317,7 @@
 	size_t i;
 
 	for (i = 0; i < len; i++)
-		mctp_rx_consume_one(serial, *(uint8_t *)(buf + i));
+		mctp_rx_consume_one(serial, ((const uint8_t *)buf)[i]);
 }
 
 #ifdef MCTP_HAVE_FILEIO
@@ -330,7 +330,8 @@
 		return -1;
 
 	if (len < 0) {
-		mctp_prerr("can't read from serial device: %m");
+		mctp_prerr("can't read from serial device: %s",
+			   strerror(errno));
 		return -1;
 	}
 
@@ -353,7 +354,7 @@
 {
 	serial->fd = open(device, O_RDWR);
 	if (serial->fd < 0)
-		mctp_prerr("can't open device %s: %m", device);
+		mctp_prerr("can't open device %s: %s", device, strerror(errno));
 
 	return 0;
 }