New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 612349 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug



Sign in to add a comment

brotli fails to build in Windows gn, doesn't try to build in gyp

Project Member Reported by brucedaw...@chromium.org, May 17 2016

Issue description

crrev.com/1956893002 added the "bro" target to gn builds. However it fails to build on Windows because of warnings. The warnings are:

c:\src\chromium4\src\third_party\brotli\enc\cluster.h(91) : error C2220: warning treated as error - no 'object' file generated
c:\src\chromium4\src\third_party\brotli\enc\cluster.h(91) : warning C4701: potentially uninitialized local variable 'p' used

c:\src\chromium4\src\third_party\brotli\enc\hash.h(659): error C2220: warning treated as error - no 'object' file generated
c:\src\chromium4\src\third_party\brotli\enc\hash.h(659): warning C4146: unary minus operator applied to unsigned type, result still unsigned

This happens when building the all target or the 'bro' target. These fixes avoid the warnings, as would suppressing the warnings:

diff --git a/third_party/brotli/enc/cluster.h b/third_party/brotli/enc/cluster.h
index 5054faf..28d7c98 100644
--- a/third_party/brotli/enc/cluster.h
+++ b/third_party/brotli/enc/cluster.h
@@ -63,7 +63,7 @@ void CompareAndPushToQueue(const HistogramType* out,
     idx1 = t;
   }
   bool store_pair = false;
-  HistogramPair p;
+  HistogramPair p = {};
   p.idx1 = idx1;
   p.idx2 = idx2;
   p.cost_diff = 0.5 * ClusterCostDiff(cluster_size[idx1], cluster_size[idx2]);
diff --git a/third_party/brotli/enc/hash.h b/third_party/brotli/enc/hash.h
index 8716863b..e0e8a33 100644
--- a/third_party/brotli/enc/hash.h
+++ b/third_party/brotli/enc/hash.h
@@ -656,7 +656,7 @@ class HashToBinaryTree {
   void Init(int lgwin, size_t position, size_t bytes, bool is_last) {
     if (need_init_) {
       window_mask_ = (1u << lgwin) - 1u;
-      invalid_pos_ = static_cast<uint32_t>(-window_mask_);
+      invalid_pos_ = static_cast<uint32_t>(-static_cast<int32_t>(window_mask_));
       for (uint32_t i = 0; i < kBucketSize; i++) {
         buckets_[i] = invalid_pos_;
       }

Meanwhile the gyp builds are unaffected, apparently because "bro" is not setup to build on gyp, which seems odd, but may be intentional if this is for Android builds only.

 

Comment 1 by smaier@chromium.org, May 17 2016

Status: Started (was: Assigned)
Does anyone know how to replicate this compilation issues on Linux? I don't have access to a Windows machine.
Cc: eustas@chromium.org
Project Member

Comment 3 by bugdroid1@chromium.org, May 18 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b8adfa4cfb3e1e06b473428a79090e92edf4ab8d

commit b8adfa4cfb3e1e06b473428a79090e92edf4ab8d
Author: smaier <smaier@chromium.org>
Date: Wed May 18 13:16:13 2016

Fix Brotli warnings on Windows

Brotli files have some warnings that kill the Windows compiler. This
change modifies the Brotli source files to pass the Windows compile.

BUG= 612349 

Review-Url: https://codereview.chromium.org/1981333002
Cr-Commit-Position: refs/heads/master@{#394397}

[modify] https://crrev.com/b8adfa4cfb3e1e06b473428a79090e92edf4ab8d/third_party/brotli/README.chromium
[modify] https://crrev.com/b8adfa4cfb3e1e06b473428a79090e92edf4ab8d/third_party/brotli/enc/cluster.h
[modify] https://crrev.com/b8adfa4cfb3e1e06b473428a79090e92edf4ab8d/third_party/brotli/enc/hash.h

Comment 4 by smaier@chromium.org, May 18 2016

Status: Fixed (was: Started)
Thanks for finding this Bruce. I'm marking the Windows breakage as closed. You also mentioned the gyp files being absent: I have started a new code review (https://codereview.chromium.org/1992703003) associated with crbug.com/332521 to address this.

Sign in to add a comment