Restore Disabled C++ Warnings In Our Modules

Many compiler warnings are disabled by the “WindowsPlatformCompilerSetup.h”, including but not limited to:

  • Unreferenced function paramater.
  • Local variable initialized but not used.
  • Constexpr function will be called at run-time.

This header gets transitively included into all of our modules where it turns the warnings off as well. So far, I tried the following fixes:

  • Enable a set of warnings inside of PCH for a module -> this fails because some of the headers included from the engine will trigger a warning and stop the compilation.
  • Include a separate header for enabling warnings into each “.cpp” file in a module (as a last include so that the previous situation does not occur) -> forces a programmer to manually include a header into each “.cpp”.

Is there any better solution how to prevent this from happening so the warnings are enabled for our modules?

[Attachment Removed]

Steps to Reproduce[Attachment Removed]

Enabling the suppressed compiler warnings is something we’re working on, but due to the reason you mention in that engine code has outstanding warnings that need to be addressed this isn’t something I have a satisfying answer for. We’re slowly either fixing or migrating warnings that were previously suppressed in code to instead be controlled via TargetRules / ModuleRules settings so they can be selectively enabled or disabled on a per target or per module basis, but I can’t give any concrete timelines on that effort.

[Attachment Removed]