summaryrefslogtreecommitdiff
path: root/tools/include/linux/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/include/linux/string.h')
-rw-r--r--tools/include/linux/string.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/include/linux/string.h b/tools/include/linux/string.h
index f436d2420a18..115ecca5f8b9 100644
--- a/tools/include/linux/string.h
+++ b/tools/include/linux/string.h
@@ -13,7 +13,15 @@ int strtobool(const char *s, bool *res);
* However uClibc headers also define __GLIBC__ hence the hack below
*/
#if defined(__GLIBC__) && !defined(__UCLIBC__)
+// pragma diagnostic was introduced in gcc 4.6
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wredundant-decls"
+#endif
extern size_t strlcpy(char *dest, const char *src, size_t size);
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic pop
+#endif
#endif
char *str_error_r(int errnum, char *buf, size_t buflen);