Detection of unitialized member variables

Discussion in 'C++' started by toddel@gmail.com, Oct 24, 2005.

  1. Guest

    Are there any compilers or 3rd party tools available that will detect
    at compile time that a member variable has been declared but not
    initialized? I know most compilers do this for local variables but we
    are looking to detect member vars.

    /Todd
     
    , Oct 24, 2005
    #1
    1. Advertising

  2. mlimber Guest

    wrote:
    > Are there any compilers or 3rd party tools available that will detect
    > at compile time that a member variable has been declared but not
    > initialized? I know most compilers do this for local variables but we
    > are looking to detect member vars.
    >
    > /Todd


    You may be able to get your compiler to do it by setting it at the
    highest warning level, but there are several Lint programs that will do
    that, too. PC-Lint/FlexeLint from Gimpel software (www.gimpel.com) are
    a commercial example.

    Cheers! --M
     
    mlimber, Oct 24, 2005
    #2
    1. Advertising

  3. Greg Guest

    wrote:
    > Are there any compilers or 3rd party tools available that will detect
    > at compile time that a member variable has been declared but not
    > initialized? I know most compilers do this for local variables but we
    > are looking to detect member vars.
    >
    > /Todd


    gcc 4.0 (and perhaps earlier versions) can issue such a warning.

    Greg
     
    Greg, Oct 24, 2005
    #3
    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. Darrell Grainger

    Re: Unitialized Memory Read In sscanf()

    Darrell Grainger, Jun 24, 2003, in forum: C Programming
    Replies:
    1
    Views:
    834
    Alan Balmer
    Jun 24, 2003
  2. Eric Sosman

    Re: Unitialized Memory Read In sscanf()

    Eric Sosman, Jun 24, 2003, in forum: C Programming
    Replies:
    0
    Views:
    858
    Eric Sosman
    Jun 24, 2003
  3. Adam Monsen
    Replies:
    3
    Views:
    253
    =?iso-8859-1?Q?Fran=E7ois?= Pinard
    Sep 9, 2005
  4. Greg

    Unitialized pointers?

    Greg, Oct 11, 2004, in forum: C Programming
    Replies:
    5
    Views:
    346
  5. Brad

    Unitialized variables

    Brad, Sep 3, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    96
    A. Sinan Unur
    Sep 3, 2004
Loading...

Share This Page