On Wed, Sep 2, 2009 at 9:55 AM, Alexey Proskuryakov <[email protected]> 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). > > > http://stackoverflow.com/questions/998425/why-does-const-imply-internal-linkage-in-c-when-it-doesnt-in-c > http://bytes.com/topic/c/answers/62013-const-has-internal-linkage-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 on it... 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 :) PK
_______________________________________________ webkit-dev mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

