Enable useful compiler warnings, add C++17 attributes to enable optimisation & avoid false warnings #54
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.
Description
A number of useful compiler warnings have been omitted or disabled in the build script, presumably due to a number of false positives or cases where these warnings do not apply.
This PR enables modifies warnings as follows:
const
andnoreturn
attributes, which allow further compiler optimisations if functions that can be marked as such are found by the compiler.This PR then proceeds to resolve hundreds of instances of those warnings throughout the code, primarily by applying relevant C++17 attributes as follows:
[[maybe_unused]]
. Any new code that unintentionally fails to use a parameter will be flagged by the-Wunused
warning. The presence of this attribute also makes the design intention clear to readers, and avoids reliance on comments or variable names such as "ignored" as presently found in the code.final
, which enables devirtualisation of certain calls, and improves optimised performance.final
, which enables the compiler to devirtualise function calls, improving optimised performance likewise.BTC/BGL PR reward address
ETH/USDT: 0x50b92AB67A3D3DE8c3506D9287893D9a52655486