common: fix errors from -Wrange-loop-analysis rule#13140
common: fix errors from -Wrange-loop-analysis rule#13140mattklein123 merged 4 commits intoenvoyproxy:masterfrom
Conversation
Fixes envoyproxy#13139. Signed-off-by: Michael Rebello <me@michaelrebello.com>
|
CI failure looks unrelated: |
Signed-off-by: Michael Rebello <me@michaelrebello.com>
|
cc @yanavlasov @lizan based on context in #11949 |
This change is dependent on envoyproxy/envoy#13140 to fix upstream build failures with Xcode 12. Signed-off-by: Michael Rebello <me@michaelrebello.com>
This change is dependent on envoyproxy/envoy#13140 to fix upstream build failures with Xcode 12. Signed-off-by: Michael Rebello <me@michaelrebello.com>
|
Hmm, it looks like there are some external violations: Is there a way to apply this rule only for Envoy code or do we need to fix each dependency? |
|
cc @danzh2010. We will need to fix QUICHE also since ultimately xcode will end up complaining there also. |
Signed-off-by: Michael Rebello <me@michaelrebello.com>
|
Looks like Envoy Mobile does not depend on QUICHE code right now, so the fixes in this PR are sufficient for getting Envoy Mobile to compile again. I dropped the build rule change and instead filed an issue to enable that separately, which should allow this PR to go green: #13154 @mattklein123 mind taking another look? |
|
I believe remaining CI failures are unrelated |
|
Please merge main to fix CI. /wait |
Signed-off-by: Michael Rebello <me@michaelrebello.com>
This change is dependent on envoyproxy/envoy#13140 to fix upstream build failures with Xcode 12. Signed-off-by: Michael Rebello <me@michaelrebello.com>
|
In addition the quiche issues the following is required to build in MacOS diff --git a/source/extensions/filters/http/common/compressor/compressor.cc b/source/extensions/filters/http/common/compressor/compressor.cc
index 4e0a1b48c..e8e604295 100644
--- a/source/extensions/filters/http/common/compressor/compressor.cc
+++ b/source/extensions/filters/http/common/compressor/compressor.cc
@@ -224,7 +224,7 @@ CompressorFilter::chooseEncoding(const Http::ResponseHeaderMap& headers) const {
}
// Find all encodings accepted by the user agent and adjust the list of allowed compressors.
- for (const auto token : StringUtil::splitToken(*accept_encoding_, ",", false /* keep_empty */)) {
+ for (const auto& token : StringUtil::splitToken(*accept_encoding_, ",", false /* keep_empty */)) {
EncPair pair =
std::make_pair(StringUtil::trim(StringUtil::cropRight(token, ";")), static_cast<float>(1));
const auto params = StringUtil::cropLeft(token, ";"); |
|
Thanks @moderation - added that as a task for #13154 |
Xcode 12 builds with this enabled, so adding this to Envoy will ensure compatibility and prevent breakages in Envoy Mobile's iOS build. Resolves envoyproxy#13140. Signed-off-by: Michael Rebello <me@michaelrebello.com>
This change is dependent on #13140 to fix upstream build failures with Xcode 12. Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
This change is dependent on #13140 to fix upstream build failures with Xcode 12. Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
With Xcode 12,
-Wrange-loop-analysisbecomes active and yields errors preventing Envoy Mobile from building. This PR fixes the errors in Envoy code yielded by this rule.Unfortunately, I was unable to enable this rule in Envoy's build because of third party violations, but that is now being tracked in #13154.
Fixes #13139.
Risk Level: Low
Testing: Existing unit tests
Signed-off-by: Michael Rebello me@michaelrebello.com