resolve stricter warnings
In order to convert this repository to Meson, we need to make it
compile under `warning_level=3`. Fix a number of warning classes
across the repository or disable them.
Some fixes are:
* Add missing header files.
* Fully initialize structs as necessary.
* Add `__attribute__((unused))` on parameters as necessary.
* Fix comparisons between signed and unsigned.
* Fix printf specifiers as necessary.
* Avoid case-fallthrough.
* Remove if conditions which are always true.
Some warnings would require extensive code changes, due to their
pervasive use, and so are disabled at a per-file level:
* `-Wpointer-arith`
* `-Wunused-result`
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: If8992b9108f12b39f796ed090ba29868c9f3c627
diff --git a/test/flash_write.c b/test/flash_write.c
index c5f998c..d330981 100644
--- a/test/flash_write.c
+++ b/test/flash_write.c
@@ -37,7 +37,7 @@
#define MEM_SIZE 3
#define ERASE_SIZE 1
-int ioctl(int fd, unsigned long request, ...)
+int ioctl(int fd __attribute__((unused)), unsigned long request, ...)
{
va_list ap;
@@ -59,7 +59,7 @@
{
struct mbox_context _context, *context = &_context;
struct backend *backend = &context->backend;
- char src[MEM_SIZE];
+ uint8_t src[MEM_SIZE];
uint8_t *map;
int rc;