Skip to content

Clear the -Wall -Wextra warning backlog #161

Description

@HugoFara

#156 turns on -Wall -Wextra for ForeFire's own sources, informational rather than fatal, with -DFOREFIRE_WARNINGS_AS_ERRORS=ON for whoever is clearing a file. This issue tracks emptying the backlog.

Linux/GCC: 428 warning lines, 373 unique after deduplicating header warnings repeated across translation units.

Category Count
-Wunused-parameter 314
-Wdeprecated-copy 65
-Wmissing-field-initializers 24
-Wreorder 9 lines / 3 sites
-Wunused-variable 7

The 65 -Wdeprecated-copy are one missing operator. All trace to FFPoint, which declares a copy constructor (FFPoint.h:42) and a virtual destructor (line 39) but no copy assignment. Its members are three doubles with no owned memory, so the implicit assignment is behaviourally correct — a Rule of Three violation, not a live bug. Declaring FFPoint& operator=(const FFPoint&) clears 15% of the backlog in one line.

The 3 -Wreorder sites are benign (BurningRatioLayer.h:49, RosLayer.h:50, one more): every member is initialised from a constructor parameter, not from another member. Worth fixing anyway so the warning stays able to catch the dangerous version.

Where they concentrate:

46  src/BurningRatioLayer.h      25  src/NCXYZTDataLayer.h
32  src/Command.cpp              24  src/stb_image_write.h
27  src/FluxLayer.h              23  src/RosLayer.h
25  src/TimeGradientDataLayer.h  23  src/GradientDataLayer.h
25  src/PropagativeLayer.h       23  src/FireDomain.cpp

The DataLayer subclasses dominate and share a shape: the unused parameters are interface methods a given layer type genuinely does not need. [[maybe_unused]] or an omitted parameter name, repeated — good first-contribution work.

Suggested order

  1. Move vendored src/stb_image_write.h (1724 lines, 24 warnings) and generated src/colormap.h (2883 lines) into third_party/, which Unit tests for every propagation and flux model, and -Wall -Wextra #156 creates. Both are currently globbed in by file(GLOB_RECURSE SRC_FILES src/*.cpp).
  2. The FFPoint one-liner.
  3. The layer headers.
  4. Command.cpp and FireDomain.cpp.

Turn on FOREFIRE_WARNINGS_AS_ERRORS per file as each is cleared, repository-wide at zero. Worth finishing before the C++17 move so the two diffs do not mix.


Drafted by Claude Opus 5 from a codebase audit. Reviewed by a maintainer before filing.

EDIT: rewrote for human readability.

Activity

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions