This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: two small fixes.
Alfred Minarik <a8601248@unet.univie.ac.at> writes:
[...]
| Now there is of course the question whether one is allowed to
| get the address of the static const ios_base data members
| as normally you don't have a use for it (there are
| other uses besides taking the address directly, but that's
| what it is finally about - having it real somewhere in memory).
|
| If you agree that this use is ok this would be conclusive enough
| to integrate the patch, and all the following is unimportant.
|
| If not then why the linker error ?
| After rethought also the libstdc++ implementation has no
| other use for them beside better scoped #defin(s). And my
| mentioned guess was probably wrong. Nevertheless the patch make it compile.
| The mysterious part is that in the previous simple examples also gcc-2.95
| fails, so there are two possibilities:
Any static data member (const or not) shall be defined somewhere in
the translation unit, *outside* the class that declares/initializes
it.
Moreover static const data members have external linkage, so yes, the
linker was right in complaining.
-- Gaby