From eab4bd5cee2faa78962184f7c04b03ec3383e3c7 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 3 Nov 2014 17:18:55 +0100 Subject: Fix a fatal Clang warning on Linux Two fromstrerror_helper overloads are defined, to manage the fact that strerror_r returns an int or a char* depending on the system. The problem is that then only one overload used (again, depending on the actual stderror_r return type), leading to one of the two overload to be unused and thus triggering the unused function warning. kernel/qsystemerror.cpp:64:27: error: unused function 'fromstrerror_helper' [-Werror,-Wunused-function] static inline QString fromstrerror_helper(int, const QByteArray &buf) Change-Id: I6a1c8e1a4b7d14068b682db26002ff68ad36167c Reviewed-by: Olivier Goffart --- src/corelib/kernel/qsystemerror.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/kernel/qsystemerror.cpp') diff --git a/src/corelib/kernel/qsystemerror.cpp b/src/corelib/kernel/qsystemerror.cpp index 5c185e1d62..3b1d808520 100644 --- a/src/corelib/kernel/qsystemerror.cpp +++ b/src/corelib/kernel/qsystemerror.cpp @@ -61,11 +61,11 @@ namespace { // version in portable code. However, it's impossible to do that if // _GNU_SOURCE is defined so we use C++ overloading to decide what to do // depending on the return type - static inline QString fromstrerror_helper(int, const QByteArray &buf) + static inline Q_DECL_UNUSED QString fromstrerror_helper(int, const QByteArray &buf) { return QString::fromLocal8Bit(buf); } - static inline QString fromstrerror_helper(const char *str, const QByteArray &) + static inline Q_DECL_UNUSED QString fromstrerror_helper(const char *str, const QByteArray &) { return QString::fromLocal8Bit(str); } -- cgit v1.2.3