Locked History Attachments

ChangeRequests/9965

Summary of problem description

Actual behavior

There are numerous (read: thousands) warnings during a build of MITK (at least with MSVC2008) that can be fixed trivially.

Expected behavior

It should be possible to compile MITK without any warnings again.

Cause of the bug

Wannabe smartass compilers and bad programming style. ;-)

Proposed solution

The most warnings which are related to multiple overloaded assignment operators of the property classes (which is what we want) can be eliminated by locally disable the warning with push and pop pragmas in MSVC. This was discussed with Sascha.

The second most warnings ware related to deprecated warnings. There is already a CMake function which was in use for that. It can be extended to cover SCL_SECURE_NO_WARNINGS.

Make implicit casts explicit when necessary.

Remove GCC visibility pragmas because the related problem is already fixed with compiler flags and a raise of the required GCC version for building MITK.

Remove unused variables and unused references.

Forward-declare structs consistently as structs and not as classes and structs mixed.

Check if defines were already defined when trying to define them (NOMINMAX).

Return a value from each code path in a function that is supposed to return a value.

Remove various C&P errors that were overseen because they were interpreted as unknown labels or suffixes by the compiler.

Affected classes

Core classes beside the property classes that are affected are:

  • CallbackFromGUIThread (GCC visibility)
  • DicomSeriesReader (unused variable)

  • Operation (GCC visibility)
  • Module (struct forward-declared as struct and class)
  • ModuleRegistry (struct forward-declared as struct and class)

  • ServiceReference (struct forward-declared as struct and class)

How will the bugfix get tested?

The actual behaviour of the code is not changed. Code is written the explicit way instead of implicit but known deductions of the compiler were necessary.