two small fixes.

Gabriel Dos Reis dosreis@cmla.ens-cachan.fr
Fri Aug 6 06:15:00 GMT 1999


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


More information about the Libstdc++ mailing list