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

Ville Voutilainen ville.voutilainen at gmail.com
Thu Feb 27 13:40:34 CET 2020


On Thu, 27 Feb 2020 at 09:15, Alex Blasche <alexander.blasche at qt.io> wrote:

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

They are counter-productive, yes. The compilers overreach, see below.

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

The chance is very good; I talked about this with the maintainer of
GCC already, and he was amenable to disabling
an "unknown attribute" warning if the attribute has a namespace. For
attributes that don't have namespaces,
diagnosing unknown attributes allows diagnosing typos, so it's
unlikely that all such warnings would be axed.

I may need to write that patch myself. In any case, such solutions
don't help GCC 9.x users or users of earlier
GCC 10.x versions, in case the patch wouldn't hit GCC 10.

I think the chance of success is similarly good with clang; the case
for not complaining about namespaced
attributes is fairly clear. But that change isn't something I have
time to patch into clang. I haven't looked at
MSVC or other compilers.


More information about the Development mailing list