Re: [Development] Removing the use of 'register'

2013-06-15 Thread Stephen Kelly
On Friday, June 14, 2013 07:48:18 Thiago Macieira wrote:
> On sexta-feira, 14 de junho de 2013 11.44.00, Stephen Kelly wrote:
> > 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?
> 
> Either remove or disable the warning. A macro makes no sense for this -- too
> ugly.

The warning can only be disabled by adding -Wno-deprecated. I think that has 
to change though:

 http://llvm.org/bugs/show_bug.cgi?id=16336

Thanks,

-- 
Stephen Kelly  | 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

signature.asc
Description: This is a digitally signed message part.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Removing the use of 'register'

2013-06-14 Thread Thiago Macieira
On sexta-feira, 14 de junho de 2013 16.25.28, Thiago Macieira wrote:
> On sábado, 15 de junho de 2013 00.59.18, Giuseppe D'Angelo wrote:
> > On 15 June 2013 00:37, Thiago Macieira  wrote:
> > > C++11 did not change the meaning of the keyword. This is a completely
> > > made-up warning by Clang, like the GCC warning that says const in
> > > prvalue
> > > return types makes no sense or the one telling you to use () around &&
> > > with ||.
> >
> > No, "register" is officially deprecated (N3337 §D.2 [depr.register]),
> > so the warning "makes sense". My concern was about getting such
> > warnings from code we don't have control upon, that is, 3rdparty code
> > (qtbase/3rdparty, webkit, v8...)
>
> N3337 isn't in C++11 (which was N3291). It can only be C++14.

Actually, naming N3337 threw me off. That's the editor's update to N3291, so
it's got the same content modulo editorial updates.

depr.register wasn't added by any paper. It actually came via member body
submissions (UK 86):
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#809

Please note that #definer register  is not acceptable. The keyword is
still used in extension code with assembly. In fact, for some IA-64 it is
sometimes required if you need to select specific registers.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center


signature.asc
Description: This is a digitally signed message part.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Removing the use of 'register'

2013-06-14 Thread Thiago Macieira
On sábado, 15 de junho de 2013 00.59.18, Giuseppe D'Angelo wrote:
> On 15 June 2013 00:37, Thiago Macieira  wrote:
> > C++11 did not change the meaning of the keyword. This is a completely
> > made-up warning by Clang, like the GCC warning that says const in prvalue
> > return types makes no sense or the one telling you to use () around &&
> > with ||.
> No, "register" is officially deprecated (N3337 §D.2 [depr.register]),
> so the warning "makes sense". My concern was about getting such
> warnings from code we don't have control upon, that is, 3rdparty code
> (qtbase/3rdparty, webkit, v8...)

N3337 isn't in C++11 (which was N3291). It can only be C++14.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center


signature.asc
Description: This is a digitally signed message part.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Removing the use of 'register'

2013-06-14 Thread Thiago Macieira
On sexta-feira, 14 de junho de 2013 23.24.50, Giuseppe D'Angelo wrote:
> On 14 June 2013 11:44, Stephen Kelly  wrote:
> >  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?
> Am I right at assuming that this warning triggers only when compiling
> C++ files in C++11 mode? If not, would it be possible we disable it
> selectively, f.i. for code in 3rdparty?

C++11 did not change the meaning of the keyword. This is a completely made-up 
warning by Clang, like the GCC warning that says const in prvalue return types 
makes no sense or the one telling you to use () around && with ||.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center


signature.asc
Description: This is a digitally signed message part.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Removing the use of 'register'

2013-06-14 Thread Thorbjørn Martsum
The only macro that could make sense seems to be
#define register

I say +1 for removal since 'register' is just noise, and if any compiler
actually still uses this flag it will typically just cause less optimized
code.

On Fri, Jun 14, 2013 at 4:48 PM, Thiago Macieira
wrote:

> On sexta-feira, 14 de junho de 2013 11.44.00, Stephen Kelly wrote:
> > 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?
>
> Either remove or disable the warning. A macro makes no sense for this --
> too
> ugly.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> ___
> Development mailing list
> Development@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
>
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Removing the use of 'register'

2013-06-14 Thread Thiago Macieira
On sexta-feira, 14 de junho de 2013 11.44.00, Stephen Kelly wrote:
> 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?

Either remove or disable the warning. A macro makes no sense for this -- too 
ugly.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center


signature.asc
Description: This is a digitally signed message part.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] Removing the use of 'register'

2013-06-14 Thread Stephen Kelly

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  | 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

smime.p7s
Description: S/MIME cryptographic signature
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development