[Development] Can we remove recommendation against unnamed namespaces from Qt coding conventions?

Mathias Hasselmann mathias at taschenorakel.de
Mon Feb 26 18:26:08 CET 2024


Am 21.02.2024 um 20:28 schrieb Thiago Macieira:

> On Wednesday, 21 February 2024 10:56:49 PST Edward Welbourne via Development
> wrote:
>> (Incidentally, the ways I can think of to say "has no name" tend to
>> suffer from some degree of precedent as "has a name but it has not been
>> disclosed" - the anonymous author of a pamphlet, the unnamed person who
>> reported a problem.  I'm currently unable to think of such a precedent
>> for "nameless", but I suspect that's only that I can't currently think
>> of it.  Then again, if a namespace with no name actually does have a
>> secret name, I guess that just matches the linguistic baggage.)
> It's an unnamed namespace, not anonymous namespace.
>
> There's such a thing as anonymous union, though.

You are obviously referring to the wording in the actual C++ standard.

Still I'd really avoid rebuking Edward or anyone else for using the term 
"anonymous namespace". It's simply the term established by Clang and GCC:

https://godbolt.org/z/xTe8zfhfs

Guess we either have to live with this inconsistency, well or convince 
the developers of CCC and Clang to correct their code.

Ciao
Mathias



More information about the Development mailing list