Skip to content

Fix Compiler Warnings - Zero Hour + Tools - Level 2 warnings #504

Open

Description

@Mauller

Related to #482 as a sub task.

Dependent on #503 being completed first to decrease number of warnings shown.

Fix all level 2 compiler warnings in Zero Hour + Tools for the Vs22 build.

Only Fix warnings that won't change behaviour or break VC6 compatability.

Activity

  1. added
    MinorSeverity: Minor < Major < Critical < Blocker
    BuildAnything related to building, compiling
    and removed
    MinorSeverity: Minor < Major < Critical < Blocker
    on Mar 25, 2025
  2. Mauller commented on Mar 28, 2025

    @Mauller
    Author

    Starting a Comment here with warnings that won't get changes in this first pass that could lead to changes in behaviour, will keep it updated as new things appear.

    File - Line - Bug - Info

    [ZH] BuddyThread.cpp - 363 - Fallthrough in Switch case - BUDDYREQUEST_DENYADD is missing a break and will fall into BUDDYREQUEST_SETSTATUS
    [ZH] LookAtXlat.cpp - 374 - Fallthrough in Switch case - MSG_RAW_MOUSE_WHEEL falls into MSG_META_OPTIONS but has a comment stating this should happen, it would be safer to just call "stopScrolling()" at the end of MSG_RAW_MOUSE_WHEEL

    [ZH] PeerThread.cpp - 189 - Uninitialsed Variables - PeerThreadClass constructor only partialy initialises the object.
    [ZH] registry.cpp - 25 - Macro Redefinition - WIN32_LEAN_AND_MEAN is considered redefined.

    [ZH] ControlBar.h - 481->486 - Missing Function Definitions - Destructor, init, reset, update and draw functions all lack bodies.
    [ZH] ControlBar.h - 452 - Uninitialised Variables - Constructor only partially initialises the object.

    [ZH] PeerThread.h - 46->174 - Uninitialised Varaibles - PeerRequest class contains structs with uninitialised variables.

    [ZH] FlightDeckBehavior.cpp - 198 - Discarding return value - return value from iterator is ignored
    [ZH] FlightDeckBehavior.cpp - 1360 - Null pointer dereference - no guard against null pointer dereferencing
    [ZH] FlightDeckBehavior.cpp - 61 - Uninitialised Variables - FlightDeckBehaviorModuleData constructor only partially initialised the object.

  3. Mauller commented on Mar 28, 2025

    @Mauller
    Author

    The only warnings that can be fixed at Level 2 are enumerations that were made static by someone, they were likely thinking it would make them internal to the compilation unit. But that is not what static means in C++ compared to C.

    So i will move those fixes into level 3 warnings.

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

Metadata

Metadata

Assignees

Labels

BuildAnything related to building, compilingMinorSeverity: Minor < Major < Critical < Blocker

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions