This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: V3 PATCH: Static data members


> The copmiler should treat in-class initialized static const data
> members just like enums, and code written that way is cleaner.  If the
> compiler doesn't treat those two things identically, that is a
> quality-of-implementation issue.  I would recommend that in V3 we do
> what we think makes the cleanest code; if the compiler generates
> inferior code file a bug against the compiler.

I agree that code written with in-class initialized static const data 
members is cleaner. I'd like to continue using them.

I think these patches are fine, for what it's worth. Thanks Mark: static 
linkage and g++ has always been a bit of a black art, so getting this 
properly linked on multiple platforms will take a bit of hacking around.

As an aside, I've noticed a lot of difficulty with gdb and these beasts. 
In particular, the "Cannot address memory at address 0x000" stuff. That's 
particularly annoying for me, because then gdb freaks on when you try to 
look inside c++ classes that use this idiom, which include but are not 
limited to string, locale, and most of iostreams. Is there anyway that 
g++ can give a warning about these constructs, so that I can make sure 
that everything is indeed defined? That would be quite helpful.

-benjamin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]