From bc108d7c7ea491bfc8618a8389d4806aea44bfbf Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 3 Jan 2016 14:51:07 -0200 Subject: Work around GCC 6 warning about offset outside bounds of string This is a false positive because the only offset that can be outside the bounds was the last one (-1), which could not be reached in this line because of the qBound on the line before limiting the maximum value. The -1 wasn't generated by the Perl script embedded in the file anyway. qdbuserror.cpp:142:64: error: offset outside bounds of constant string [-Werror] Change-Id: I24a735698d3c4a719fc9ffff1425f8aad5e5978e Reviewed-by: Alex Blasche Reviewed-by: Frederik Gladhorn --- src/dbus/qdbuserror.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dbus/qdbuserror.cpp') diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp index 40e97ae483..d6a329cfe8 100644 --- a/src/dbus/qdbuserror.cpp +++ b/src/dbus/qdbuserror.cpp @@ -130,11 +130,11 @@ static const int errorMessages_indices[] = { 0, 6, 40, 76, 118, 153, 191, 231, 273, 313, 349, 384, 421, 461, 501, 540, 581, 617, 661, 705, 746, 789, 833, 874, - 916, 961, 1005, -1 + 916, 961, 1005 }; static const int errorMessages_count = sizeof errorMessages_indices / - sizeof errorMessages_indices[0] - 1; + sizeof errorMessages_indices[0]; static inline const char *get(QDBusError::ErrorType code) { -- cgit v1.2.3