This repository was archived by the owner on Mar 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Copy MDC-iOS' warnings. #3
Open
ajsecord
wants to merge
3
commits into
material-foundation:develop
Choose a base branch
from
ajsecord:add-warnings
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,45 +1,30 @@ | ||
| """Macros for building Objective-C libraries with strict warnings.""" | ||
|
|
||
| # This list is derived from | ||
| # http://programmers.stackexchange.com/questions/122608/clang-warning-flags-for-objective-c-development | ||
| # with a few turned off because the warning code is widely present in Material | ||
| # Components and seems innocuous. | ||
| COMMON_COPTS = [ | ||
| "-Wall", # Standard known-to-be-bugs warnings. | ||
| "-Wcast-align", # Casting a pointer such that alignment is broken. | ||
| "-Wconversion", # Numeric conversion warnings. | ||
| "-Wdocumentation", # Documentation checks. | ||
| "-Werror", # All warnings as errors. | ||
| "-Wextra", # Many useful extra warnings. | ||
| "-Wdocumentation", # Warn when documentation is out of date. | ||
| "-Wimplicit-atomic-properties", # Dynamic properties should be non-atomic. | ||
| "-Wmissing-prototypes", # Global function is defined without a previous prototype. | ||
| "-Wnewline-eof", # No newline at the end of the file. | ||
| "-Wno-error=deprecated", # Deprecation warnings are never errors. | ||
| "-Wno-error=deprecated-implementations", # Deprecation warnings are never errors. | ||
| "-Wno-partial-availability", | ||
| "-Wno-sign-conversion", # Do not warn on sign conversions. | ||
| "-Wno-unused-parameter", # Do not warn on unused parameters. | ||
| "-Woverlength-strings", # Strings longer than the C maximum. | ||
| "-Wshadow", # Local variable shadows another variable, parameter, etc. | ||
| "-Wstrict-selector-match", # Compiler can't figure out the right selector. | ||
| "-Wstrict-prototypes", | ||
| "-Wundeclared-selector", # Compiler doesn't see a selector. | ||
| "-Wunreachable-code", # Code will never be reached. | ||
| "-Wunused-comparison", | ||
| "-Wunused-const-variable", | ||
| "-Wunused-exception-parameter", | ||
| "-Wunused-function", | ||
| "-Wunused-label", | ||
| "-Wunused-member-function", | ||
| "-Wunused-private-field", | ||
| "-Wunused-property-ivar", | ||
| "-Wunused-result", | ||
| "-Wunused-value", | ||
| "-Wunused-variable", | ||
| "-Wunused-volatile-lvalue", | ||
| "-Wused-but-marked-unused", | ||
| # Warning flags to be used for all library and example code. | ||
| # | ||
| # Clang's warning reference: https://clang.llvm.org/docs/DiagnosticsReference.html | ||
| # General xcconfig docs: https://pewpewthespells.com/blog/xcconfig_guide.html | ||
| # | ||
| # * Our basic warnings cover most things and make warnings into errors. | ||
| # * If a warning is (transitively) enabled by our basic warnings, do not include it separately. | ||
| # * For warnings not enabled by our basic warnings, add them to the extra warnings. | ||
| # * To change a warning-as-error into just a warning, add it to the ignorable warnings. | ||
| # * To disable a warning completely, add it to the disabled warnings. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "...using the format
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| # | ||
| BASIC_WARNINGS = ["-Wall", "-Wextra", "-Werror"] | ||
| EXTRA_WARNINGS = [ | ||
| "-Wcast-align", "-Wconversion", "-Watomic-properties", | ||
| "-Wmissing-prototypes", "-Wnewline-eof", "-Woverlength-strings", | ||
| "-Wshadow-all", "-Wstrict-selector-match", "-Wundeclared-selector", | ||
| "-Wunreachable-code", "-Wstrict-prototypes" | ||
| ] | ||
| IGNORABLE_WARNINGS = [ | ||
| "-Wno-error=deprecated", "-Wno-error=deprecated-implementations" | ||
| ] | ||
| DISABLED_WARNINGS = [ | ||
| "-Wno-partial-availability", "-Wno-sign-conversion", "-Wno-unused-parameter" | ||
| ] | ||
| COMMON_COPTS = BASIC_WARNINGS + EXTRA_WARNINGS + IGNORABLE_WARNINGS + DISABLED_WARNINGS | ||
|
|
||
| def strict_warnings_objc_library( | ||
| name, | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"...using the format
-Wno-error=<warning>"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done