From 9782938045c33b37fe0bbb6cdf00e406cd3d837e Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 11 Jul 2014 12:22:50 +0200 Subject: Introduce Q_DECL_UNUSED_MEMBER for clang Since version 3.2, clang warns about unused member variables (-Wunused-private-field). Marking such members with Q_DECL_UNUSED_MEMBER will silence this warning. This is a cleaner way than using Q_UNUSED() somewhere in the class methods (like we did previously in qloggingcategory.cpp). It mirrors Q_DECL_UNUSED for unused variables, which however can't be used unconditionally for member variables because e.g. gcc will complain. Change-Id: I2afff683a7c3bae3bdcd684e5085a643887bb2a0 Reviewed-by: Thiago Macieira Reviewed-by: hjk --- src/corelib/io/qloggingcategory.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/io/qloggingcategory.h') diff --git a/src/corelib/io/qloggingcategory.h b/src/corelib/io/qloggingcategory.h index 573af2105c..2025911e2c 100644 --- a/src/corelib/io/qloggingcategory.h +++ b/src/corelib/io/qloggingcategory.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -80,7 +80,7 @@ public: static void setFilterRules(const QString &rules); private: - void *d; // reserved for future use + Q_DECL_UNUSED_MEMBER void *d; // reserved for future use const char *name; #ifdef Q_BIG_ENDIAN @@ -100,7 +100,7 @@ private: AtomicBools bools; QBasicAtomicInt enabled; }; - bool placeholder[4]; // reserve for future use + Q_DECL_UNUSED_MEMBER bool placeholder[4]; // reserved for future use }; #define Q_DECLARE_LOGGING_CATEGORY(name) \ -- cgit v1.2.3