aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-27 20:43:19 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-27 20:43:19 +0100
commitf2c5ac590d442a32e2d5cd77af776a05b977b949 (patch)
tree0dc1859835688927e127920e2ca3f89ff9012a28
parentfix errors (diff)
downloadslibc-f2c5ac590d442a32e2d5cd77af776a05b977b949.tar.gz
slibc-f2c5ac590d442a32e2d5cd77af776a05b977b949.tar.bz2
slibc-f2c5ac590d442a32e2d5cd77af776a05b977b949.tar.xz
fix errors and warnings
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
-rw-r--r--include/alloca.h4
-rw-r--r--include/stdio.h2
-rw-r--r--include/stdlib.h14
-rw-r--r--include/unistd.h6
-rw-r--r--src/stdio/printf.c2
-rw-r--r--src/string/str/rawstrstr.c1
-rw-r--r--src/string/str/strcaseends.c3
-rw-r--r--src/string/str/strcasestarts.c3
-rw-r--r--src/string/str/strends.c3
-rw-r--r--src/string/str/strpbrk.c3
-rw-r--r--src/string/str/strset.c4
-rw-r--r--src/string/str/strstarts.c3
12 files changed, 25 insertions, 23 deletions
diff --git a/include/alloca.h b/include/alloca.h
index 4c9db33..ff2f8c8 100644
--- a/include/alloca.h
+++ b/include/alloca.h
@@ -46,7 +46,7 @@
*
* @since Always.
*/
-void* alloca(size_t);
+void* alloca(size_t)
__GCC_ONLY(__attribute__((__warn_unused_result__)));
#if defined(__GNUC__)
# define alloca(size) __builtin_alloca(size)
@@ -94,7 +94,7 @@ void (needstack)(int);
* @param func The function in the source code whence the check was made,
* `NULL` if unknown (C99 is required.)
*/
-void __needstack(int, const char*, int, const char*)
+void __needstack(int, const char*, int, const char*);
diff --git a/include/stdio.h b/include/stdio.h
index 5c2f6ca..67ec7a3 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -515,7 +515,7 @@ int vdprintf(int, const char* restrict, va_list)
* @since Always.
*/
int vsockprintf(int, int, const char* restrict, va_list)
- __GCC_ONLY(__attribute__((__nonnull__(3), __format__(__slibc_printf__, 3, 4))));
+ __GCC_ONLY(__attribute__((__nonnull__(3))));
#endif
/**
diff --git a/include/stdlib.h b/include/stdlib.h
index 0cb5f49..86f5f15 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -288,20 +288,6 @@ long long int atoq(const char*)
#endif
-#if !defined(__PORTABLE)
-/**
- * This function is identical to `atoll`.
- *
- * This is a Linux libc extension.
- *
- * @since Always.
- */
-long long int atoq(const char*)
- __deprecated("'atoq' is obsolete and not portable, use 'atoll' instead.")
- __GCC_ONLY(__attribute__((__warn_unused_result__, __nonnull__)));
-#endif
-
-
#if defined(__SVID_SOURCE) || defined(__BSD_SOURCE)
/**
* This function shall in some manner clear the environment.
diff --git a/include/unistd.h b/include/unistd.h
index 963bb96..f4d699c 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -891,7 +891,7 @@ int fexecve(int, char* const[], char* const[]);
* @since Always.
*/
char* searchpath(const char*)
- __GCC_ONLY(__attribute__((__nonnull__(0), __warn_unused_result__)));
+ __GCC_ONLY(__attribute__((__nonnull__(1), __warn_unused_result__)));
#endif
#if defined(__SLIBC_SOURCE)
@@ -932,7 +932,7 @@ char* searchpath(const char*)
* @since Always.
*/
char* searchpath2(const char*, const char*)
- __GCC_ONLY(__attribute__((__nonnull__(0), __warn_unused_result__)));
+ __GCC_ONLY(__attribute__((__nonnull__(1), __warn_unused_result__)));
/**
* Search the environment variable $PATH for an executable
@@ -974,7 +974,7 @@ char* searchpath2(const char*, const char*)
* @since Always.
*/
char* searchpath3(const char*, const char*, const char*)
- __GCC_ONLY(__attribute__((__nonnull__(0), __warn_unused_result__)));
+ __GCC_ONLY(__attribute__((__nonnull__(1), __warn_unused_result__)));
#endif
diff --git a/src/stdio/printf.c b/src/stdio/printf.c
index 53be281..0c6d2cf 100644
--- a/src/stdio/printf.c
+++ b/src/stdio/printf.c
@@ -482,7 +482,7 @@ int dprintf(int fd, const char* restrict format, ...)
*
* @since Always.
*/
-int sockprintf(int fd, int flags, const char* format restrict, ...)
+int sockprintf(int fd, int flags, const char* restrict format, ...)
{
V(sockprintf(fd, flags, format, args));
}
diff --git a/src/string/str/rawstrstr.c b/src/string/str/rawstrstr.c
index 8349210..e733583 100644
--- a/src/string/str/rawstrstr.c
+++ b/src/string/str/rawstrstr.c
@@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
+#include <stdint.h>
diff --git a/src/string/str/strcaseends.c b/src/string/str/strcaseends.c
index b9a1756..bc7d765 100644
--- a/src/string/str/strcaseends.c
+++ b/src/string/str/strcaseends.c
@@ -18,6 +18,9 @@
#include <string.h>
+# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
+
+
/**
* Check whether a string ends with a specific string.
diff --git a/src/string/str/strcasestarts.c b/src/string/str/strcasestarts.c
index d17b936..e014080 100644
--- a/src/string/str/strcasestarts.c
+++ b/src/string/str/strcasestarts.c
@@ -18,6 +18,9 @@
#include <string.h>
+# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
+
+
/**
* Check whether a string starts with a specific string.
diff --git a/src/string/str/strends.c b/src/string/str/strends.c
index 43dd562..336106f 100644
--- a/src/string/str/strends.c
+++ b/src/string/str/strends.c
@@ -18,6 +18,9 @@
#include <string.h>
+# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
+
+
/**
* Check whether a string ends with a specific string.
diff --git a/src/string/str/strpbrk.c b/src/string/str/strpbrk.c
index 4cfb9ed..ce5b7c6 100644
--- a/src/string/str/strpbrk.c
+++ b/src/string/str/strpbrk.c
@@ -18,6 +18,9 @@
#include <string.h>
+# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
+
+
/**
* This function works like `strcspn`,
diff --git a/src/string/str/strset.c b/src/string/str/strset.c
index ac1d551..a1ff63f 100644
--- a/src/string/str/strset.c
+++ b/src/string/str/strset.c
@@ -33,9 +33,9 @@
*/
char* strset(char* str, int c)
{
- char* s = segment;
+ char* s = str;
while (*s)
*s++ = (char)c;
- return segment;
+ return str;
}
diff --git a/src/string/str/strstarts.c b/src/string/str/strstarts.c
index e562f63..04ed7ad 100644
--- a/src/string/str/strstarts.c
+++ b/src/string/str/strstarts.c
@@ -18,6 +18,9 @@
#include <string.h>
+# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
+
+
/**
* Check whether a string starts with a specific string.