www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - extern const definition has internal linkage only

This is, I believe, a bug in the way that DMC++ 
treats the construct:
  extern const int whatever = 0;
It will be compiled without being exposed
for use by other translation units (in the
beta compiler as of Aug 8).

My understanding of C++ is that a const
object can be given external linkage
by prefixing its definition with the
keyword 'const'.

This can be seen in section "9.2 Linkage" of
Stroustrup's "The C++ Programming Language"
3rd Ed.  I'm pretty sure I've seen it in the
standard as well, but I'm too lazy to dredge
it up from my failed previous work machine.

-- 
-Larry Brasfield
(address munged, s/sn/h/ to reply)
Aug 13 2002