Simplify the warning-flag comments - #6265
Open
q10 wants to merge 1 commit into
Open
Conversation
Summary: NOTE: No linked task. Please associate a task with this diff. Comments only. No flag changes. The comments gave a full explanation for each flag, so the shared rules appeared many times. This change states each rule once, in the header of its list, and keeps a comment on a single flag only where that flag has a trap. The rules that now appear once: - a flag in the portable list works on both compilers - g++ stops with an error when it gets an unknown `-W` option - a `-Wno-error=` line for a clang-only flag must stay in the clang list - the suppression lists come last, so they have priority - a `-Wno-error=` line does nothing if no list above enables the warning The comments that remain describe traps that a reader cannot see from the code: the plural spelling of `-Wunused-local-typedefs`, the flags that `-Wall` includes on clang but not on gcc, and the correct way to repair a `-Wshift-sign-overflow` site. Each flag that does not stop the build now points to its `-Wno-error=` line, and each `-Wno-error=` line gives the condition to remove it. The text follows ASD-STE100: short sentences, active voice, present tense, and one idea in each sentence. The file goes from 694 to 529 lines. The comments go from 361 to 196 lines. Differential Revision: D117107573
Contributor
|
@q10 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D117107573. |
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.
Summary:
NOTE: No linked task. Please associate a task with this diff.
Comments only. No flag changes.
The comments gave a full explanation for each flag, so the shared rules
appeared many times. This change states each rule once, in the header of its
list, and keeps a comment on a single flag only where that flag has a trap.
The rules that now appear once:
-Woption-Wno-error=line for a clang-only flag must stay in the clang list-Wno-error=line does nothing if no list above enables the warningThe comments that remain describe traps that a reader cannot see from the
code: the plural spelling of
-Wunused-local-typedefs, the flags that-Wallincludes on clang but not on gcc, and the correct way to repair a
-Wshift-sign-overflowsite.Each flag that does not stop the build now points to its
-Wno-error=line,and each
-Wno-error=line gives the condition to remove it.The text follows ASD-STE100: short sentences, active voice, present tense,
and one idea in each sentence.
The file goes from 694 to 529 lines. The comments go from 361 to 196 lines.
Differential Revision: D117107573