g++ -Weffc++ key and libraries

Discussion in 'C++' started by crimaniak@googlemail.com, Dec 1, 2009.

  1. Guest

    Hi All!

    I read about -Weffc++ key and try to use it to make my code more
    reliable. But compiler gives me about 1500 warnings for project and
    most of them located in used libraries: boost, dlib, json_spirit and
    so on. For example every time then you use boost::noncopyable (class
    foo : boost::noncopyable ....) you have warning about non-virtual
    destructor in base class boost::noncopyable. Additional you have
    warnings about absence of operator= and copy constructor. And so on,
    so on, so on...

    - Is boost need some adjusting to support Scott Meyers
    recommendations?
    - Is -Weffc++ mode too paranoic?

    What do you think?
     
    , Dec 1, 2009
    #1
    1. Advertising

  2. wrote:
    > Hi All!
    >
    > I read about -Weffc++ key


    What's that?

    > and try to use it to make my code more
    > reliable. But compiler gives me about 1500 warnings for project and
    > most of them located in used libraries: boost, dlib, json_spirit and
    > so on. For example every time then you use boost::noncopyable (class
    > foo : boost::noncopyable ....) you have warning about non-virtual
    > destructor in base class boost::noncopyable. Additional you have
    > warnings about absence of operator= and copy constructor. And so on,
    > so on, so on...
    >
    > - Is boost need some adjusting to support Scott Meyers
    > recommendations?


    You should probably ask in Boost forums.

    > - Is -Weffc++ mode too paranoic?


    What's "-Weffc++ mode"?

    > What do you think?


    Not much. I've not had my coffee yet.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Dec 1, 2009
    #2
    1. Advertising

  3. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Victor Bazarov wrote:

    > wrote:
    >> Hi All!
    >>
    >> I read about -Weffc++ key

    >
    > What's that?
    >
    > > and try to use it to make my code more
    >> reliable. But compiler gives me about 1500 warnings for project and
    >> most of them located in used libraries: boost, dlib, json_spirit and
    >> so on. For example every time then you use boost::noncopyable (class
    >> foo : boost::noncopyable ....) you have warning about non-virtual
    >> destructor in base class boost::noncopyable. Additional you have
    >> warnings about absence of operator= and copy constructor. And so on,
    >> so on, so on...
    >>
    >> - Is boost need some adjusting to support Scott Meyers
    >> recommendations?

    >
    > You should probably ask in Boost forums.
    >
    >> - Is -Weffc++ mode too paranoic?

    >
    > What's "-Weffc++ mode"?
    >
    >> What do you think?

    >
    > Not much. I've not had my coffee yet.
    >
    > V


    - -Weffc++ is some warning about bad C++ programming practice:

    - - default copy constructor or assignment operator declared in a class with
    object pointer members
    - - member not initialised in the member initialisation list in constructor
    - - non-virtual destructor found in base classes
    - - returning anything other than *this in operator=
    - - returning a reference to a local object
    - - overloading sequence operators

    Quote from man page:
    When selecting this option, be aware that the standard library
    headers do not obey all of these guidelines; use grep -v to filter out those
    warnings.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iEYEARECAAYFAksVIEYACgkQG6NzcAXitM9ZhACgg9V09Dr8upUPl640TYqSEKUp
    jiIAoItttgVZDpfz3TYuWaDhR/V8fk6N
    =3NBk
    -----END PGP SIGNATURE-----
     
    Michael Tsang, Dec 1, 2009
    #3
  4. SeanW Guest

    On Dec 1, 6:12 am, ""
    <> wrote:
    > - Is boost need some adjusting to support Scott Meyers
    > recommendations?
    > - Is -Weffc++ mode too paranoic?
    > What do you think?


    It's not that it's too paranoid, just that it's a style
    guide that not all projects follow. There may be no
    will in various projects to compile cleanly with -Weffc++.

    Your choices are to either persuade those projects to
    get -Weffc++-clean (which could be a hard sell), put
    up with the noise, or just not use that option.

    For those that don't know, -Weffc++ is a g++ option
    that warns about violations of some recommendations from
    the "Effective C++" series.

    Sean
     
    SeanW, Dec 1, 2009
    #4
  5. Guest

    Thanks all for answers!

    Now I will try to find how to eliminate some warnings because I still
    want to use this mode fro my code but don't want to find my errors
    between tons of unusable warnings from libraries.
     
    , Dec 2, 2009
    #5
  6. red floyd Guest

    On Dec 2, 2:45 pm, ""
    <> wrote:
    > Thanks all for answers!
    >
    > Now I will try to find how to eliminate some warnings because I still
    > want to use this mode fro my code but don't want to find my errors
    > between tons of unusable warnings from libraries.


    Then try gnu.g++.help, not here. This is a question about how to
    use a specific toolset.
     
    red floyd, Dec 3, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Karsten Wutzke
    Replies:
    21
    Views:
    934
    Roedy Green
    Jun 29, 2007
  2. Sriram Srinivasan
    Replies:
    13
    Views:
    583
    Benjamin Kaplan
    Nov 12, 2009
  3. wimalopaan
    Replies:
    2
    Views:
    441
    wimalopaan
    Aug 18, 2011
  4. M P
    Replies:
    1
    Views:
    500
  5. DeMarcus

    Is this a -Weffc++ bug in gcc?

    DeMarcus, Aug 16, 2012, in forum: C++
    Replies:
    9
    Views:
    516
    Tobias Müller
    Aug 17, 2012
Loading...

Share This Page