[Development] Removing the use of 'register'

Stephen Kelly stephen.kelly at kdab.com
Fri Jun 14 11:44:00 CEST 2013


Hi,

A recent patch to clang enables a warning for any use of the register storage 
class specifier when -std=c++11 is used.

 $ ~/dev/build/qtbase/llvm/bin/clang++ -std=c++11   -fPIE -
I$HOME/dev/prefix/qtbase/include  -c 
~/dev/src/qtbase/src/corelib/tools/qstring.h
clang-3.4: warning: treating 'c-header' input as 'c++-header' when in C++ 
mode, this behavior is deprecated
 In file included from 
/home/stephen/dev/src/qtbase/src/corelib/tools/qstring.h:45:
 In file included from 
/home/stephen/dev/prefix/qtbase/include/QtCore/qchar.h:45:
 In file included from 
/home/stephen/dev/prefix/qtbase/include/QtCore/qglobal.h:987:
 In file included from 
/home/stephen/dev/prefix/qtbase/include/QtCore/qglobalstatic.h:47:
 In file included from 
/home/stephen/dev/prefix/qtbase/include/QtCore/qatomic.h:47:
 In file included from 
/home/stephen/dev/prefix/qtbase/include/QtCore/qbasicatomic.h:84:
 In file included from 
/home/stephen/dev/prefix/qtbase/include/QtCore/qatomic_x86.h:46:
 /home/stephen/dev/prefix/qtbase/include/QtCore/qgenericatomic.h:175:13: 
warning: 'register' storage class specifier is deprecated [-Wdeprecated]
             register T tmp = load(_q_value);
             ^~~~~~~~~
 /home/stephen/dev/prefix/qtbase/include/QtCore/qgenericatomic.h:210:13: 
warning: 'register' storage class specifier is deprecated [-Wdeprecated]
             register T tmp = BaseClass::load(_q_value);
             ^~~~~~~~~

 http://thread.gmane.org/gmane.comp.compilers.clang.scm/74932

This will be quite noisy for Qt and for users of Qt. Should we remove the use 
of register from Qt? Or replace it with Q_REGISTER which is empty for c++11?

Thanks,

-- 
Stephen Kelly <stephen.kelly at kdab.com> | Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3636 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130614/adcd250e/attachment.bin>


More information about the Development mailing list