Fix warnings that were exposed when running with SK_DEBUG enable on an optimized release build.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1917223006
Review-Url: https://codereview.chromium.org/1917223006
diff --git a/gyp/common.gypi b/gyp/common.gypi
index e0196cf..9ca2895 100644
--- a/gyp/common.gypi
+++ b/gyp/common.gypi
@@ -102,6 +102,16 @@
'Release_Developer': {
'inherit_from': ['Release'],
'defines': [ 'SK_DEBUG=1' ],
+ 'conditions': [
+ [ 'skia_clang_build == 0', {
+ # gcc has problems providing useful warnings of these types for
+ # optimized builds.
+ 'cflags': [
+ '-Wno-maybe-uninitialized',
+ '-Wno-strict-overflow',
+ ],
+ }],
+ ],
},
},
}],
diff --git a/src/animator/SkDrawBitmap.cpp b/src/animator/SkDrawBitmap.cpp
index 64c2850..1912408 100644
--- a/src/animator/SkDrawBitmap.cpp
+++ b/src/animator/SkDrawBitmap.cpp
@@ -73,7 +73,7 @@
SkColorGetG(fColor), SkColorGetB(fColor));
if (rowBytes > 0)
SkDebugf("rowBytes=\"%d\" ", rowBytes);
- const char* formatName;
+ const char* formatName SK_INIT_TO_AVOID_WARNING;
switch (format) {
case 0: formatName = "none"; break;
case 1: formatName = "A8"; break;
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 87ecd4e..fbda7e8 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -2250,6 +2250,7 @@
, fIsCurve(false) {
fExpectedDir = kInvalid_DirChange;
// warnings
+ fPriorPt.set(0,0);
fLastPt.set(0, 0);
fCurrPt.set(0, 0);
fLastVec.set(0, 0);
diff --git a/src/pathops/SkPathOpsCommon.cpp b/src/pathops/SkPathOpsCommon.cpp
index 86a8cb0..c9ef7a4 100644
--- a/src/pathops/SkPathOpsCommon.cpp
+++ b/src/pathops/SkPathOpsCommon.cpp
@@ -113,7 +113,7 @@
segment = angle->segment();
SkOpSpanBase* start = angle->start();
SkOpSpanBase* end = angle->end();
- int maxWinding;
+ int maxWinding SK_INIT_TO_AVOID_WARNING;
if (sortable) {
segment->setUpWinding(start, end, &maxWinding, &sumWinding);
}