Enable full compiler flag set (matches made/commons/regex) - #34
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Brings mcodec's
project.scalaup to the same//> using optionsset as made/commons/regex, including-Wsafe-init -Werror -Wunused:all.Verified locally (JVM): full test suite passes clean with the new flags. Also confirmed
-Wsafe-initdoes not hang here (unlike mrpc, where it's disabled for a documented reason) — 90s bound compile finished fine.-Werror -Wunused:allsurfaced 4 real warnings, fixed as follows:src/mcodec/CborInput.scala(skipChunks): the outermajorparam and each chunk's own major type (cm, fromreader.readInitial()) were both unused — meaning a chunk's major type is never checked against the container's. Marked both explicitly unused (@unused/_) rather than silently adding validation logic, and left aTODOcomment describing the gap: worth a look — malformed CBOR with mismatched chunk major types inside an indefinite-length container is currently accepted rather than rejected. Not fixed here since it's a behavior decision, not a compiler-flag cleanup.src/mcodec/Derivation.scala:11(given self: MCodec[T] = deferred): flagged unused because-Wunusedcan't see that it's read via implicit search only afterderivedRec'stransparent inlinebody is expanded at call sites (needed for recursive/self-referentialT). Suppressed with@nowarnrather than removed/renamed, to keep behavior identical — renaming it anonymous first (to test whether it was just the name) still triggered "unused local definition", confirming this isn't a naming issue.src/mcodec/Derivation.scala:119(summonFrompresence-check pattern): same class of inline/macro false positive, suppressed with@nowarnon the expression.ExtendedStdCodecsTest.scala,JavaHashSetIntTest.scala): removed, confirmed genuinely unused.test/mcodec/IoContractExtTest.scala:-Wsafe-initrejectedfloatCases/tsCases/binCasesas not-yet-initialized when captured bytest(...)closures declared earlier in the class body. Converted tolazy val— standard fix for this pattern, no behavior change (values are still computed once, just on first access instead of at construction).