public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16165] New: -Weffc++ item 11 improvements
@ 2004-06-23 22:26 bkoz at gcc dot gnu dot org
  2004-06-24  1:54 ` [Bug c++/16165] " giovannibajo at libero dot it
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-06-23 22:26 UTC (permalink / raw)
  To: gcc-bugs

There are issues (some in bugzilla already) about over-zealous warnings for
class members that are pointers, but don't really fall into EFC++ item 11.

One is member function pointers.

Another is data that is a pointer, but hasn't been allocated by new.

See:

http://gcc.gnu.org/ml/gcc/2004-06/msg01379.html

For some commentary and an intriguing suggestion for future work.

-benjamin

-- 
           Summary: -Weffc++ item 11 improvements
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bkoz at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16165


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/16165] -Weffc++ item 11 improvements
  2004-06-23 22:26 [Bug c++/16165] New: -Weffc++ item 11 improvements bkoz at gcc dot gnu dot org
@ 2004-06-24  1:54 ` giovannibajo at libero dot it
  2004-06-24  2:13 ` bkoz at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: giovannibajo at libero dot it @ 2004-06-24  1:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-06-24 01:44 -------
Yes. Also look here for a nifty heuristic which might indeed work very well:
http://gcc.gnu.org/ml/gcc/2004-06/msg01389.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-24 01:44:00
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16165


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/16165] -Weffc++ item 11 improvements
  2004-06-23 22:26 [Bug c++/16165] New: -Weffc++ item 11 improvements bkoz at gcc dot gnu dot org
  2004-06-24  1:54 ` [Bug c++/16165] " giovannibajo at libero dot it
@ 2004-06-24  2:13 ` bkoz at gcc dot gnu dot org
  2004-06-24  2:17 ` bkoz at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-06-24  2:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-06-24 02:09 -------

Also see 8211

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16165


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/16165] -Weffc++ item 11 improvements
  2004-06-23 22:26 [Bug c++/16165] New: -Weffc++ item 11 improvements bkoz at gcc dot gnu dot org
  2004-06-24  1:54 ` [Bug c++/16165] " giovannibajo at libero dot it
  2004-06-24  2:13 ` bkoz at gcc dot gnu dot org
@ 2004-06-24  2:17 ` bkoz at gcc dot gnu dot org
  2004-07-08 11:43 ` giovannibajo at libero dot it
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-06-24  2:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-06-24 02:13 -------

Also, another problem is base classes with private copy contructors and
assignment operators, and derived classes without explicit definitions giving a
false warning. Although, I suppose the checks for actual allocation or a
destructor would pick this up too.

This is a pretty common idiom, ie. std::locale::facet and everything derived
from it, singletons, etc.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16165


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/16165] -Weffc++ item 11 improvements
  2004-06-23 22:26 [Bug c++/16165] New: -Weffc++ item 11 improvements bkoz at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-06-24  2:17 ` bkoz at gcc dot gnu dot org
@ 2004-07-08 11:43 ` giovannibajo at libero dot it
  2004-07-08 12:36 ` giovannibajo at libero dot it
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: giovannibajo at libero dot it @ 2004-07-08 11:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-07-08 11:43 -------
Mine, testing a patch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |giovannibajo at libero dot
                   |dot org                     |it
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16165


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/16165] -Weffc++ item 11 improvements
  2004-06-23 22:26 [Bug c++/16165] New: -Weffc++ item 11 improvements bkoz at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-07-08 11:43 ` giovannibajo at libero dot it
@ 2004-07-08 12:36 ` giovannibajo at libero dot it
  2004-07-08 17:02 ` bkoz at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: giovannibajo at libero dot it @ 2004-07-08 12:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-07-08 12:36 -------
Patch posted, waiting for review:
http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00769.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic, patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16165


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/16165] -Weffc++ item 11 improvements
  2004-06-23 22:26 [Bug c++/16165] New: -Weffc++ item 11 improvements bkoz at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-07-08 12:36 ` giovannibajo at libero dot it
@ 2004-07-08 17:02 ` bkoz at gcc dot gnu dot org
  2004-07-09  0:59 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-07-08 17:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-07-08 17:02 -------

Hey can you put your patch in bugzilla as an attachment? I'm having problems
with the one in your message.

thanks,
benjamin

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16165


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/16165] -Weffc++ item 11 improvements
  2004-06-23 22:26 [Bug c++/16165] New: -Weffc++ item 11 improvements bkoz at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-07-08 17:02 ` bkoz at gcc dot gnu dot org
@ 2004-07-09  0:59 ` cvs-commit at gcc dot gnu dot org
  2004-07-09  1:00 ` giovannibajo at libero dot it
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-07-09  0:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-07-09 00:59 -------
Subject: Bug 16165

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	giovannibajo@gcc.gnu.org	2004-07-09 00:59:05

Modified files:
	gcc/cp         : ChangeLog class.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/warn: effc3.C 

Log message:
	PR c++/8211
	PR c++/16165
	* class.c (check_field_decls): Improve -Weffc++ warning: do not
	warn for pointers to functions/members, or for classes without
	destructors.
	
	PR c++/8211
	PR c++/16165
	* g++.dg/warn/effc3.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4180&r2=1.4181
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.626&r2=1.627
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3960&r2=1.3961
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/effc3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16165


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/16165] -Weffc++ item 11 improvements
  2004-06-23 22:26 [Bug c++/16165] New: -Weffc++ item 11 improvements bkoz at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2004-07-09  0:59 ` cvs-commit at gcc dot gnu dot org
@ 2004-07-09  1:00 ` giovannibajo at libero dot it
  2004-07-09  4:05 ` bkoz at gcc dot gnu dot org
  2004-07-10  0:26 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: giovannibajo at libero dot it @ 2004-07-09  1:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-07-09 01:00 -------
Fixed for GCC 3.5.0, thank you for your report!

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16165


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/16165] -Weffc++ item 11 improvements
  2004-06-23 22:26 [Bug c++/16165] New: -Weffc++ item 11 improvements bkoz at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2004-07-09  1:00 ` giovannibajo at libero dot it
@ 2004-07-09  4:05 ` bkoz at gcc dot gnu dot org
  2004-07-10  0:26 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-07-09  4:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-07-09 04:05 -------

Excellent, this works well. I've also tested this patch and can confirm this has
no regressions on x86/linux.

Now <string> compiles with -Weffc++, plus others. Thanks!

-benjamin

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16165


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/16165] -Weffc++ item 11 improvements
  2004-06-23 22:26 [Bug c++/16165] New: -Weffc++ item 11 improvements bkoz at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2004-07-09  4:05 ` bkoz at gcc dot gnu dot org
@ 2004-07-10  0:26 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-10  0:26 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16165


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-07-10  0:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-23 22:26 [Bug c++/16165] New: -Weffc++ item 11 improvements bkoz at gcc dot gnu dot org
2004-06-24  1:54 ` [Bug c++/16165] " giovannibajo at libero dot it
2004-06-24  2:13 ` bkoz at gcc dot gnu dot org
2004-06-24  2:17 ` bkoz at gcc dot gnu dot org
2004-07-08 11:43 ` giovannibajo at libero dot it
2004-07-08 12:36 ` giovannibajo at libero dot it
2004-07-08 17:02 ` bkoz at gcc dot gnu dot org
2004-07-09  0:59 ` cvs-commit at gcc dot gnu dot org
2004-07-09  1:00 ` giovannibajo at libero dot it
2004-07-09  4:05 ` bkoz at gcc dot gnu dot org
2004-07-10  0:26 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).