diff options
author | yunlian@chromium.org <yunlian@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-14 07:56:01 +0000 |
---|---|---|
committer | yunlian@chromium.org <yunlian@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-14 07:56:01 +0000 |
commit | b6e05ccff3112487674688880f106da06aa9b6c3 (patch) | |
tree | 821003fed3e09ee8ec8dfb1719897b6ca202bc76 /url | |
parent | 231f09dfe315fd4edee4acb49f59a94e5e06d4ce (diff) | |
download | chromium_src-b6e05ccff3112487674688880f106da06aa9b6c3.zip chromium_src-b6e05ccff3112487674688880f106da06aa9b6c3.tar.gz chromium_src-b6e05ccff3112487674688880f106da06aa9b6c3.tar.bz2 |
url: work around a gcc warning bug.
Gcc 4.9 has a bug in reporting false positive array out of bound
warning. This cl adds progma to disable the warning.
BUG=chromium:392872
TEST=The warning is gone.
Review URL: https://codereview.chromium.org/384843002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'url')
-rw-r--r-- | url/url_canon_ip.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/url/url_canon_ip.cc b/url/url_canon_ip.cc index 6ed8ba7..ee70165 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; |