[Qt-creator] unnamed namespace and internal linkage

Lorenz Haas lykurg at gmail.com
Tue Sep 22 13:45:07 CEST 2015


> I don't know, but shouldn't the "static" keyword be preferred anyway due
> to being less noisy?

Okay, beside the theoretical question, let's make it concrete -and
clear-: https://github.com/qtproject/qt-creator/blob/51bb52139c479cca2dae82eb08aeb8d04718fca1/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp#L52
Should it be:

a) namespace { const char kUseOtherFiles[] = "useOtherFiles"; }
b) namespace { static const char kUseOtherFiles[] = "useOtherFiles"; }
c) static const char kUseOtherFiles[] = "useOtherFiles";

So one should favor c, right?

Lorenz



More information about the Qt-creator mailing list