diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-09-01 21:34:07 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-09-01 21:34:07 +0200 |
commit | 7b7352be6ed17876cc957e7a57e2348231aa856e (patch) | |
tree | 285e8842e630c5f5dfa70099538ab1b25ce95e23 | |
parent | m (diff) | |
download | slibc-7b7352be6ed17876cc957e7a57e2348231aa856e.tar.gz slibc-7b7352be6ed17876cc957e7a57e2348231aa856e.tar.bz2 slibc-7b7352be6ed17876cc957e7a57e2348231aa856e.tar.xz |
fix more warnings
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r-- | src/err.c | 3 | ||||
-rw-r--r-- | src/string/memset.c | 2 | ||||
-rw-r--r-- | src/string/strlen.c | 3 |
3 files changed, 7 insertions, 1 deletions
@@ -18,6 +18,7 @@ #include <err.h> #include <error.h> #include <errno.h> +#include <stdlib.h> @@ -119,6 +120,7 @@ void err(int status, const char* format, ...) void verr(int status, const char* format, va_list args) { verror(status, errno, format, args); + exit(status); } @@ -154,5 +156,6 @@ void errx(int status, const char* format, ...) void verrx(int status, const char* format, va_list args) { verror(status, 0, format, args); + exit(status); } diff --git a/src/string/memset.c b/src/string/memset.c index c0b87a3..f8c153a 100644 --- a/src/string/memset.c +++ b/src/string/memset.c @@ -32,7 +32,7 @@ void* memset(void* segment, int c, size_t size) /* TODO improve implementation of memset */ char* s = segment; while (size--) - *s++ = c; + *s++ = (char)c; return segment; } diff --git a/src/string/strlen.c b/src/string/strlen.c index 7a08fa0..a7aece5 100644 --- a/src/string/strlen.c +++ b/src/string/strlen.c @@ -18,6 +18,9 @@ #include <string.h> +# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" + + /** * Returns the number of bytes in a NUL-terminated |