Repository navigation
chore: flag fakematches without a Fakematch: comment - #207
Merged
Merged
Conversation
check-cleanup.py reports x++; x--, x = x, a do { } while (0) outside a macro and if (0) when no Fakematch: comment ends at most three lines above them. NON_MATCHING drafts and macro bodies are skipped.
EXTRACT_WORDS, CHECK_INIT and DO_GLOBAL_CTORS_BODY; the compiler output is unchanged.
Removing each branch leaves the compiler output byte-identical, so they are dead code, not fakematches.
Decompilation progress
No function changed its match state compared with main (606bc76). Compared with main (606bc76). C_FUZZY uses main's last measurement. |
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.
Before: CI accepted code that only steers the compiler (
x++; x--;,x = x;, ado { } while (0)outside a macro,if (0)) without any note, so readers could not tell a fakematch from real code.After: the
cleanupjob fails a pull request that adds one of these shapes unless a comment that starts withFakematch:ends at most three lines above it. Every existing case insrcis now either marked or removed.How:
scripts/check-cleanup.py: new[fakematch]rule. It skips macro bodies andNON_MATCHINGdrafts, and only new cases fail, like the other rules. It comes with a test and a short section indocs/code-cleanup.md.if (0)branches in the hero files andsetup_menu_display_textgave identical output, so they were dead code and are removed.EXTRACT_WORDS×2,CHECK_INITandDO_GLOBAL_CTORS_BODY.Fakematch:comment.main.