This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: V3 patch causes EH failures in ILP32 mode


On Wed, 23 Jun 2004 12:41:59 -0700, Mark Mitchell <mark@codesourcery.com> said:

> When I worked on an error-checking tool that had a -Weffc++-like
> feature (and said tool was actually endorsed by Scott Meyers, no
> less), we tried to figure out whether or not dynamic memory really
> was involved using various heuristics.  For example, "does the
> constructor call "new" and assign that to a data member?"

Cool!

> The -Weffc++ implementation in G++ is not as sophisticated.

Maybe one first step would be to only warn about a nonexistent copy
constructor if the class has both a raw pointer member _and_ a
destructor.  (Or (raw pointer && (destructor || assignment)),
perhaps.)  And similarly for assignment.  It should at least reduce
the false positive rate, and I would imagine (knowing nothing at all
about the relevant bits of GCC) that it would be easier to implement
than heuristics involving looking at the actual definitions of various
member functions.

David Carlton
david.carlton@sun.com


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