This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] -Weffc++ fixups
- From: Dhruv Matani <dhruvbird at gmx dot net>
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, jason at redhat dot com, Paolo Carlini <pcarlini at suse dot de>
- Date: 14 Apr 2004 14:22:10 +0530
- Subject: Re: [v3] -Weffc++ fixups
- Organization:
- References: <20040414001303.4fa2c34e.bkoz@redhat.com>
On Wed, 2004-04-14 at 10:43, Benjamin Kosnik wrote:
> This is a preliminary pass to allow -Weffc++ to be used again. I still
> have to run through the testsuite.
>
> There are some things that I think are pretty interesting, and a lot of
> additional work to get this to work fully.
> http://gcc.gnu.org/onlinedocs/gcc/C---Dialect-Options.html#C++%20Dialect%20Options
>
> In general, it would be nice if -Weffc++
>
> 1) didn't complain when assignment operators return a function that
> returns *this
>
> 2) if a base class has private copy constructors and assignment
> operators, then don't warn that they are missing in derived classes.
>
> It would be cool, in some imaginary world, if -Weffc++ could be made
> conditional on a specific item, instead of lumping them all together.
>
> Still, useful things were found, some of which are listed below. If it's
> possible, I would like to make -Weffc++ play nice with g++ so that
> people can use this feature.
>
> 1) bvector was not fixed up w/ the allocator patches
>
> 2) the base allocator classes don't have virtual destructors,
> intentionally, which I think is ok since the destructors don't really do
> anything. If people disagree, this would be a wise time to step up.
>
> 3) there are a lot of places where member initialization lists should be
> used for libstdc++.
>
> 4) cxxabi.h was reformatted. I couldn't take it anymore, but this will
> be split out from this patch.
>
> I'll wait for comments, and don't expect parts of this patch to go in at all.
Just a few questions:
1. Are the virtual dtors meant to make the -Weffc++ pass? I suspect yes.
2. Is there any way to disable parts of code from being checked by
-Weffc++ something like:
#SOME_PREPROCESSOR_COMMAND -Weffc++
//Code that should be excluded from the check.
#END
3. Will the virtual dtors increase the class size under normal
circumstances?
4. bitmap_allocator is giving problems with linking when boostrapped as
the default. Paolo is looking into it, but after seeing your patches, I
have a feeling that it's happening because the explicit instantiations
for the static is not there. Is my hunch valid?
--
-Dhruv Matani.
http://www.geocities.com/dhruvbird/
Proud to be a Vegetarian.
http://www.vegetarianstarterkit.com/
http://www.vegkids.com/vegkids/index.html