[Development] A modest proposal: disable lower-case keywords (emit, foreach, forever, signals, slots) by default

Alex Blasche alexander.blasche at qt.io
Thu Feb 27 08:15:40 CET 2020


________________________________________
From: Development <development-bounces at qt-project.org> on behalf of Ville Voutilainen <ville.voutilainen at gmail.com>

On Wed, 26 Feb 2020 at 18:45, Benjamin TERRIER <b.terrier at gmail.com> wrote:
>> I would like the idea of using attributes for this. However, compilers are allowed to warn for unknown attributes, which is useful to detect typos.
>> This means that we would get a warning for each usage of [[qt::emit]]. So unless there is a way to disable unknown attribute warnings for a specific set of custom attributes this will be a pain.

>That's debatable. [dcl.attr]/6 says
>Any attribute-token that is not recognized by the implementation is ignored.

>In general, implementations can still warn about pretty much whatever
>they please, especially considering
>that their default modes are not strictly conforming.
>
>The compilers we plan to support in Qt 6 do warn about unknown
>attributes, so the allowance point is kinda
>theoretical.

Ville, please help me understand sth. If the express intention of attributes is that users should be encouraged to have their own, aren't the warning policies exhibited by current compilers counter productive to the intent of their intended purpose? Or do attributes mostly exist for the purposes compilers themselves may face?

Also what's the chance that compiler communities might accept Qt specific attributes if for example TQtC were to put relevant patches forward?

--
Alex


More information about the Development mailing list