Skip to content

Uninitialized member variables #537

Closed

Description

@jhlegarreta

Description

Several classes have uninitialized member variables.

Steps to Reproduce

Run the tests, and check the output to the standard output:

Expected behavior

All member variables must have an initial/default value using the convention adopted in ITK.

Actual behavior

Members do not have any assigned value when being printed in tests.

Reproducibility

100%.

Versions

Current master branch.

Environment

Independent of the environment.

Activity

  1. added
    type:Bug
    Good first issue
    on Feb 24, 2019
  2. dzenanz commented on Apr 13, 2019

    @dzenanz
    Member

    Is this issue still valid? @andinet tried and failed to reproduce on Windows - Visual Studio.

  3. jhlegarreta commented on Apr 13, 2019

    @jhlegarreta
    MemberAuthor

    Having a look at the current test outputs I'd dare to say they still are:
    https://open.cdash.org/testDetails.php?test=753066184&build=5857204

      Omega lattice per thread: ()
      Delta lattice per thread: ()
    

    Having a look at the class, the members are not initialized either in their declaration or in the constructor.

    And
    https://open.cdash.org/testDetails.php?test=753066916&build=5857204

      Thresholds: ()
      Real Thresholds: ()
    

    With the same conclusion.

  4. dzenanz commented on Apr 16, 2019

    @dzenanz
    Member

    What should they be initialized to? User is required to set the thresholds he wants the labels for. I guess it is similar for the other class too.

  5. jhlegarreta commented on Apr 16, 2019

    @jhlegarreta
    MemberAuthor

    I guess there is no right/wrong answer for what they "should be initialized" to. As for the m_DeltaLatticePerThread and m_OmegaLatticePerThread they are initialized later in the code. If threads come into play, defaulting them to 1 is my best guess. I ignore if there is a default number of work units...

    As for the itk::ThresholdLabelerImageFilter, m_Thresholdsand m_RealThresholds are cleared in the constructor, so if that is correct, defaulting them to some value does indeed make no sense.

  6. added this to the ITK 6.0 Beta 1 milestone on Jan 23, 2025
  7. hjmjohnson commented on Jan 23, 2025

    @hjmjohnson
    Member

    Much work has been done to address this by @N-Dekker; we have no known open items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issuetype:Bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions