make: use compiler switches to control warnings/errors behavior #263
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note that printf formatting verification is not supported on the gnuc compiler.
On Validation in MSC
I discovered today that MSVC 2022 provides a new command line feature
/MX:
which works as a compact and streamlined solution to promoting warnings to errors from the vcxproj/props sheets. Prior to VS2022 this could only be accomplished by using#pragma
directives, which were not available at the build-system level.https://learn.microsoft.com/en-us/cpp/build/reference/wx-treat-linker-warnings-as-errors?view=msvc-170
However the printf validation of Microsoft's C compiler are ineffective: it conflicts with the printf redirection macro which is used to surface console logs to the VS output window (it was intended for C++ and does not allow printf validation in C99), and because of this, and given that clang-cl is preferred over Microsoft C, I favored the minimalist approach and implemented only clang-cl formatting options (which as an added benefit, are self-documenting).
Aside: The redirection to the VS Output window is itself a low-value behavior nowdays, thanks to drastic improvements and upgrades made to Windows Terminal applications since 2021 or so. Probably also worth scrapping.