public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16168] -Weffc++ item 14 improvements
       [not found] <bug-16168-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-05 15:56 ` f-roth at megaera dot de
  2012-01-05 17:04 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: f-roth at megaera dot de @ 2012-01-05 15:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Frederick Roth <f-roth at megaera dot de> 2012-01-05 15:55:30 UTC ---
this still happens with version 4.6.2. Can someone reconfirm this?


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

* [Bug c++/16168] -Weffc++ item 14 improvements
       [not found] <bug-16168-4@http.gcc.gnu.org/bugzilla/>
  2012-01-05 15:56 ` [Bug c++/16168] -Weffc++ item 14 improvements f-roth at megaera dot de
@ 2012-01-05 17:04 ` redi at gcc dot gnu.org
  2014-01-10 15:34 ` gcc-oren@ben-kiki.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2012-01-05 17:04 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2005-06-28 01:34:16         |2012-01-05
      Known to fail|                            |4.6.2

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-05 17:03:35 UTC ---
The bug is still open, that means it still applies, it doesn't need to be
reconfirmed

see also PR 16166 comment 3, and my comments on various bugs saying -Weffc++ is
pretty useless.


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

* [Bug c++/16168] -Weffc++ item 14 improvements
       [not found] <bug-16168-4@http.gcc.gnu.org/bugzilla/>
  2012-01-05 15:56 ` [Bug c++/16168] -Weffc++ item 14 improvements f-roth at megaera dot de
  2012-01-05 17:04 ` redi at gcc dot gnu.org
@ 2014-01-10 15:34 ` gcc-oren@ben-kiki.org
  2014-01-10 15:59 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: gcc-oren@ben-kiki.org @ 2014-01-10 15:34 UTC (permalink / raw)
  To: gcc-bugs

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

Oren Ben-Kiki <gcc-oren@ben-kiki.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gcc-oren@ben-kiki.org

--- Comment #6 from Oren Ben-Kiki <gcc-oren@ben-kiki.org> ---
This still occurs in 4.8.2, and is an extremely annoying issue; it makes
-Weffc++ very difficult to apply to a code base.

This warning really should be restricted to cases where the base class has a
virtual function. For extra credit, we could keep the warning for cases where
the base class has no virtual functions, but the derived class adds data
members with "non trivial" destructors.

This is unrelated to the question of allowing finer grained control over the
warnings of -Weffc++; emitting this warning for cases like `struct Foo{};
struct Bar : Foo{};` just makes no sense and clearly isn't what was intended by
the effective C++ rule.


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

* [Bug c++/16168] -Weffc++ item 14 improvements
       [not found] <bug-16168-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-01-10 15:34 ` gcc-oren@ben-kiki.org
@ 2014-01-10 15:59 ` redi at gcc dot gnu.org
  2014-01-10 16:11 ` oren@ben-kiki.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-01-10 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Oren Ben-Kiki from comment #6)
> This still occurs in 4.8.2, and is an extremely annoying issue; it makes
> -Weffc++ very difficult to apply to a code base.

So don't use -Weffc++ then. It's flawed in a number of ways.


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

* [Bug c++/16168] -Weffc++ item 14 improvements
       [not found] <bug-16168-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2014-01-10 15:59 ` redi at gcc dot gnu.org
@ 2014-01-10 16:11 ` oren@ben-kiki.org
  2014-01-10 16:34 ` redi at gcc dot gnu.org
  2014-01-10 16:55 ` gcc-oren@ben-kiki.org
  6 siblings, 0 replies; 12+ messages in thread
From: oren@ben-kiki.org @ 2014-01-10 16:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from oren@ben-kiki.org ---
Well... it does provide some really useful stuff.

I think it is reasonable to expect that as long as -Weffc++ is in the
compiler, it should make sense, and this specific behavior doesn't. If it
has other flaws, well then, they'd also need to be fixed.

One could argue that having -Weffc++ is the wrong approach in the 1st
place, and what we really need is a "standard" lint++, blessed by the
masters-of-C++ (assuming we can agree on who they are ;-). But that's
another discussion...


On Fri, Jan 10, 2014 at 5:59 PM, redi at gcc dot gnu.org <
gcc-bugzilla@gcc.gnu.org> wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16168
>
> --- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
> (In reply to Oren Ben-Kiki from comment #6)
> > This still occurs in 4.8.2, and is an extremely annoying issue; it makes
> > -Weffc++ very difficult to apply to a code base.
>
> So don't use -Weffc++ then. It's flawed in a number of ways.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>


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

* [Bug c++/16168] -Weffc++ item 14 improvements
       [not found] <bug-16168-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-01-10 16:11 ` oren@ben-kiki.org
@ 2014-01-10 16:34 ` redi at gcc dot gnu.org
  2014-01-10 16:55 ` gcc-oren@ben-kiki.org
  6 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-01-10 16:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to oren from comment #8)
> I think it is reasonable to expect that as long as -Weffc++ is in the
> compiler, it should make sense, and this specific behavior doesn't. If it
> has other flaws, well then, they'd also need to be fixed.

It's reasonable to expect that, but it doesn't match reality, and reality wins.
So if you find the flaws "extremely annoying" then don't use it.

Or, alternatively, contribute a fix to the compiler, ideally breaking up
-Weffc++ into separate warnings that can be enabled/disabled individually, and
fixing the outdated ones ... see PR 16166


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

* [Bug c++/16168] -Weffc++ item 14 improvements
       [not found] <bug-16168-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2014-01-10 16:34 ` redi at gcc dot gnu.org
@ 2014-01-10 16:55 ` gcc-oren@ben-kiki.org
  6 siblings, 0 replies; 12+ messages in thread
From: gcc-oren@ben-kiki.org @ 2014-01-10 16:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Oren Ben-Kiki <gcc-oren@ben-kiki.org> ---
All good points, which you could say about many opened bugs.

The `-Weffc++` flag is a useful tool to keep large code bases working, even
when written by less-than-guru C++ programmers. As someone tending a large
framework used by such developers, this specific bug "has non-trivial impact on
my code base", hence the original comment expressing the need for it to be
fixed.

I assume that the GCC maintainers keep an eye on the bug boards and fix bugs
depending on their impact on people's code. I hope this matched reality :-)

I suppose using the word "annoying", while concise, might have convey
additional unintentional connotations; if so, consider this a clarification of
the original intent.


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

* [Bug c++/16168] -Weffc++ item 14 improvements
  2004-06-24  2:21 [Bug c++/16168] New: " bkoz at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-06-28 20:51 ` bangerth at dealii dot org
@ 2005-03-29  1:49 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-29  1:49 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
   Last reconfirmed|2004-12-28 01:41:09         |2005-03-29 01:49:04
               date|                            |


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


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

* [Bug c++/16168] -Weffc++ item 14 improvements
  2004-06-24  2:21 [Bug c++/16168] New: " bkoz at gcc dot gnu dot org
  2004-06-28 19:33 ` [Bug c++/16168] " bangerth at dealii dot org
  2004-06-28 20:14 ` gdr at acm dot org
@ 2004-06-28 20:51 ` bangerth at dealii dot org
  2005-03-29  1:49 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2004-06-28 20:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-06-28 20:47 -------
I meant "It makes sense to avoid this warning in this case". We're in 
agreement here. 
 
W. 

-- 


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


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

* Re: [Bug c++/16168] -Weffc++ item 14 improvements
  2004-06-28 19:33 ` [Bug c++/16168] " bangerth at dealii dot org
@ 2004-06-28 20:16   ` Gabriel Dos Reis
  0 siblings, 0 replies; 12+ messages in thread
From: Gabriel Dos Reis @ 2004-06-28 20:16 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

You Wrote bangerth at dealii dot org
>
> ------- Additional Comments From bangerth at dealii dot org  2004-06-28
> 19:29 -------
> Here's a testcase:
> ------------
> struct A {
>     ~A ();
> };
>
> struct B : public A {};
> ------------
> g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -Weffc++ -c x.cc
> x.cc:5: warning: base class `struct A' has a non-virtual destructor
>
> I'm not really sure whether we want to avoid the error message here,

It does not make much sense in the context of modern C++.  In
particular, you get that noise each time you derive from
std::iterator<> or std::unary_function<> or such.

> but I guess it makes sense if there are no virtual functions.
No, it does not.  See above.  Even when there are virtual
functions, it is pretty useless when emitted unconditionally.

We had this discussion in the PR filled by Nathan Myers.


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

* [Bug c++/16168] -Weffc++ item 14 improvements
  2004-06-24  2:21 [Bug c++/16168] New: " bkoz at gcc dot gnu dot org
  2004-06-28 19:33 ` [Bug c++/16168] " bangerth at dealii dot org
@ 2004-06-28 20:14 ` gdr at acm dot org
  2004-06-28 20:51 ` bangerth at dealii dot org
  2005-03-29  1:49 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 12+ messages in thread
From: gdr at acm dot org @ 2004-06-28 20:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at acm dot org  2004-06-28 20:14 -------
Subject: Re:  -Weffc++ item 14 improvements

You Wrote bangerth at dealii dot org
>
> ------- Additional Comments From bangerth at dealii dot org  2004-06-28
> 19:29 -------
> Here's a testcase:
> ------------
> struct A {
>     ~A ();
> };
>
> struct B : public A {};
> ------------
> g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -Weffc++ -c x.cc
> x.cc:5: warning: base class `struct A' has a non-virtual destructor
>
> I'm not really sure whether we want to avoid the error message here,

It does not make much sense in the context of modern C++.  In
particular, you get that noise each time you derive from
std::iterator<> or std::unary_function<> or such.

> but I guess it makes sense if there are no virtual functions.
No, it does not.  See above.  Even when there are virtual
functions, it is pretty useless when emitted unconditionally.

We had this discussion in the PR filled by Nathan Myers.



-- 


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


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

* [Bug c++/16168] -Weffc++ item 14 improvements
  2004-06-24  2:21 [Bug c++/16168] New: " bkoz at gcc dot gnu dot org
@ 2004-06-28 19:33 ` bangerth at dealii dot org
  2004-06-28 20:16   ` Gabriel Dos Reis
  2004-06-28 20:14 ` gdr at acm dot org
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: bangerth at dealii dot org @ 2004-06-28 19:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-06-28 19:29 -------
Here's a testcase: 
------------ 
struct A { 
    ~A (); 
}; 
 
struct B : public A {}; 
------------ 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -Weffc++ -c x.cc 
x.cc:5: warning: base class `struct A' has a non-virtual destructor 
 
I'm not really sure whether we want to avoid the error message here, 
but I guess it makes sense if there are no virtual functions. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-28 19:29:51
               date|                            |


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


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

end of thread, other threads:[~2014-01-10 16:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-16168-4@http.gcc.gnu.org/bugzilla/>
2012-01-05 15:56 ` [Bug c++/16168] -Weffc++ item 14 improvements f-roth at megaera dot de
2012-01-05 17:04 ` redi at gcc dot gnu.org
2014-01-10 15:34 ` gcc-oren@ben-kiki.org
2014-01-10 15:59 ` redi at gcc dot gnu.org
2014-01-10 16:11 ` oren@ben-kiki.org
2014-01-10 16:34 ` redi at gcc dot gnu.org
2014-01-10 16:55 ` gcc-oren@ben-kiki.org
2004-06-24  2:21 [Bug c++/16168] New: " bkoz at gcc dot gnu dot org
2004-06-28 19:33 ` [Bug c++/16168] " bangerth at dealii dot org
2004-06-28 20:16   ` Gabriel Dos Reis
2004-06-28 20:14 ` gdr at acm dot org
2004-06-28 20:51 ` bangerth at dealii dot org
2005-03-29  1:49 ` 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).