Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(716)

Unified Diff: url/url_canon_ip.cc

Issue 384843002: url: work around a gcc warning bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_canon_ip.cc
diff --git a/url/url_canon_ip.cc b/url/url_canon_ip.cc
index 6ed8ba7203e9cc3c6a52e5286f25ae0a925d3658..ee701652bcdfc7e36d8ed843f8c606dda0f9f87f 100644
--- a/url/url_canon_ip.cc
+++ b/url/url_canon_ip.cc
@@ -204,7 +204,15 @@ CanonHostInfo::Family DoIPv4AddressToNumber(const CHAR* spec,
}
// Next, consume the last component to fill in the remaining bytes.
+ // Work around a gcc 4.9 bug. crbug.com/392872
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
uint32 last_value = component_values[existing_components - 1];
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
for (int i = 3; i >= existing_components - 1; i--) {
address[i] = static_cast<unsigned char>(last_value);
last_value >>= 8;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698