mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1683213: Don't warn on range-loop-analysis r=sheehan,sg,firefox-build-system-reviewers,andi,glandium
As described in https://quuxplusone.github.io/blog/2020/08/26/wrange-loop-analysis/ range-loop-analysis warnings sometimes recommend inferior code. Also removes pragmas that manually disable this warning. Differential Revision: https://phabricator.services.mozilla.com/D100155
This commit is contained in:
parent
fe32930e22
commit
34e20029c0
@ -97,6 +97,9 @@ check_and_add_gcc_warning("-Wfloat-zero-conversion")
|
||||
|
||||
# catches issues around loops
|
||||
check_and_add_gcc_warning("-Wloop-analysis")
|
||||
# But, disable range-loop-analysis because it can raise unhelpful false
|
||||
# positives.
|
||||
check_and_add_gcc_warning("-Wno-range-loop-analysis")
|
||||
|
||||
# catches C++ version forward-compat issues
|
||||
check_and_add_gcc_warning("-Wc++2a-compat", cxx_compiler)
|
||||
|
@ -452,10 +452,6 @@ void StringJoinAppend(
|
||||
nsTSubstring<CharType>& aOutput,
|
||||
const nsTLiteralString<CharType>& aSeparator, const InputRange& aInputRange,
|
||||
Func&& aFunc = mozilla::detail::kStringJoinAppendDefault) {
|
||||
#ifdef __clang__
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wrange-loop-analysis"
|
||||
#endif
|
||||
bool first = true;
|
||||
for (const auto& item : aInputRange) {
|
||||
if (first) {
|
||||
@ -466,9 +462,6 @@ void StringJoinAppend(
|
||||
|
||||
aFunc(aOutput, item);
|
||||
}
|
||||
#ifdef __clang__
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user