From 7b7352be6ed17876cc957e7a57e2348231aa856e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 1 Sep 2015 21:34:07 +0200 Subject: fix more warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/err.c | 3 +++ src/string/memset.c | 2 +- src/string/strlen.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/err.c b/src/err.c index f92dd60..caa8d3f 100644 --- a/src/err.c +++ b/src/err.c @@ -18,6 +18,7 @@ #include #include #include +#include @@ -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 +# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" + + /** * Returns the number of bytes in a NUL-terminated -- cgit v1.2.3-70-g09d2