aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-09-01 21:34:07 +0200
committerMattias Andrée <maandree@operamail.com>2015-09-01 21:34:07 +0200
commit7b7352be6ed17876cc957e7a57e2348231aa856e (patch)
tree285e8842e630c5f5dfa70099538ab1b25ce95e23
parentm (diff)
downloadslibc-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.c3
-rw-r--r--src/string/memset.c2
-rw-r--r--src/string/strlen.c3
3 files changed, 7 insertions, 1 deletions
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 <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