c++/8211: -Weffc++ warns about copyable classes with func ptr members

olly@survex.com olly@survex.com
Sun Oct 13 08:56:00 GMT 2002

>Number:         8211
>Category:       c++
>Synopsis:       -Weffc++ warns about copyable classes with func ptr members
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 13 08:56:00 PDT 2002
>Originator:     Olly Betts
>Release:        g++-3.2 (GCC) 3.2.1 20020924 (Debian prerelease)
Linux 2.4.19-686
-Weffc++ warns about classes which use the default copy ctor
and assignment operator and contain pointer members.  But the
warning also fires for function pointer members - this would
seem to be incorrect - a function pointer cannot be "freed"
so there aren't really any issues of resource ownership and
deallocation (unless dlclose is counted perhaps, but in
general the warning in this case seems more unhelpful than
helpful as there doesn't seem to be an easy way to suppress
Compile the attached file with:

g++ -Weffc++ -c effcpp.cc

Content-Type: application/octet-stream; name="effcpp.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="effcpp.cc"


More information about the Gcc-bugs mailing list