[webkit-dev] static const
pkasting at google.com
Wed Sep 2 10:13:59 PDT 2009
On Wed, Sep 2, 2009 at 9:55 AM, Alexey Proskuryakov <ap at webkit.org> wrote:
> I don't have a normative reference at hand, but I'm fairly sure that both
> give internal linkage in C++ (unlike in C).
Interesting; I hadn't heard this before.
It has been a number of years since I read the relevant specs. My
probably-faulty memory recalls things about most C compilers having a
concept of "common" linkage, where "int a;" defined in both foo.c and bar.c
would be accepted by the linker and turned into a single symbol. Whether
this was the default varied, but apparently a lot of older C code depended
I had also thought that C++ aimed to have all file-scope objects (not just
const ones) have internal linkage unless declared "extern", but I had
thought that wasn't actually the case.
So apparently the only part I'm confident on is that Stroustrup deprecated
"static" for internal linkage and recommends anonymous namespaces in the
general case :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev