Commit b6e05ccf authored by yunlian@chromium.org's avatar yunlian@chromium.org

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
parent 231f09df
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment