|
|
Created:
7 years, 1 month ago by tfarina Modified:
7 years, 1 month ago CC:
skia-review_googlegroups.com Base URL:
https://skia.googlecode.com/svn/trunk Visibility:
Public. |
DescriptionA fix for annoying clang error "unused-const-variabl" in third_party code.
../../third_party/externals/libwebp/src/enc/quant.c:105:23: error: unused variable 'kCoeffThresh' [-Werror,-Wunused-const-variable]
static const uint16_t kCoeffThresh[16] = {
^
1 error generated.
BUG=None
TEST=build with clang, ninja -C out/Debug most.
R=bsalomon@google.com,epoger@google.com,thakis@chromium.org
Committed: http://code.google.com/p/skia/source/detail?r=11990
Patch Set 1 #Patch Set 2 : does NOT work - why? #
Total comments: 2
Patch Set 3 : without the exclamation mark #Patch Set 4 : turn off warnings in libwebp_enc #Messages
Total messages: 14 (0 generated)
I know this is not the right fix, but I put it here for review so we can find the right way. Thanks in advance for your review!
On 2013/10/28 18:03:41, tfarina wrote: > I know this is not the right fix, but I put it here for review so we can find > the right way. > > Thanks in advance for your review! I think what we typically do is add -w to cflags for the offending package. E.g., gyp/poppler.gyp. Out of curiosity, what version of clang are you building on, and which platform? This one doesn't show up for me with Clang 3.3 that I built myself on x86-64 Linux.
My original approach, that doesn't work. Mike, please, review my patch set 2 and help me figure out why it does NOT work. Thanks,
On 2013/10/28 18:20:15, mtklein wrote: > On 2013/10/28 18:03:41, tfarina wrote: > > I know this is not the right fix, but I put it here for review so we can find > > the right way. > > > > Thanks in advance for your review! > > I think what we typically do is add -w to cflags for the offending package. > E.g., gyp/poppler.gyp. > > Out of curiosity, what version of clang are you building on, and which platform? > This one doesn't show up for me with Clang 3.3 that I built myself on x86-64 > Linux. I use the one provided by chromium: $ clang --version clang version 3.4 (trunk 192869) Target: x86_64-unknown-linux-gnu Thread model: posix $ which clang /home/tfarina/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang
https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp File gyp/libwebp.gyp (right): https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp#newcode18 gyp/libwebp.gyp:18: 'cflags!': [ '-Wno-unused-const-variable', ], Try removing the "!"? That means "remove this", doesn't it?
https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp File gyp/libwebp.gyp (right): https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp#newcode18 gyp/libwebp.gyp:18: 'cflags!': [ '-Wno-unused-const-variable', ], On 2013/10/28 19:37:37, mtklein wrote: > Try removing the "!"? That means "remove this", doesn't it? I tried both ways, with and without. It doesn't work either. That is frustrating! I uploaded the version without "!" in patch set 3. PTAL.
On 2013/10/28 19:49:11, tfarina wrote: > https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp > File gyp/libwebp.gyp (right): > > https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp#newcode18 > gyp/libwebp.gyp:18: 'cflags!': [ '-Wno-unused-const-variable', ], > On 2013/10/28 19:37:37, mtklein wrote: > > Try removing the "!"? That means "remove this", doesn't it? > I tried both ways, with and without. It doesn't work either. > That is frustrating! I uploaded the version without "!" in patch set 3. PTAL. Huh, I'd love to help but I can't reproduce the problem. Here's what I'm doing, again 64-bit Linux: $ which clang /ssd/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang $ which clang++ /ssd/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++ $ clang --version clang version 3.4 (trunk 192869) Target: x86_64-unknown-linux-gnu Thread model: posix $ clang++ --version clang version 3.4 (trunk 192869) Target: x86_64-unknown-linux-gnu Thread model: posix $ echo $CC $CXX clang clang++ $ cd ~/skia/trunk; rm -rf out/ $ ./gyp_skia && ninja -C out/Debug && ninja -C out/Release && echo ok Updating projects from gyp files... ninja: Entering directory `out/Debug' 100% STAMP obj/gyp/most.actions_depends.stamp ninja: Entering directory `out/Release' 100% STAMP obj/gyp/most.actions_depends.stamp ok No warnings! Are you doing anything different than me?
On 2013/10/28 20:05:53, mtklein wrote: > On 2013/10/28 19:49:11, tfarina wrote: > > https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp > > File gyp/libwebp.gyp (right): > > > > https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp#newcode18 > > gyp/libwebp.gyp:18: 'cflags!': [ '-Wno-unused-const-variable', ], > > On 2013/10/28 19:37:37, mtklein wrote: > > > Try removing the "!"? That means "remove this", doesn't it? > > I tried both ways, with and without. It doesn't work either. > > That is frustrating! I uploaded the version without "!" in patch set 3. PTAL. > > Huh, I'd love to help but I can't reproduce the problem. Here's what I'm doing, > again 64-bit Linux: > > $ which clang > /ssd/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang > > $ which clang++ > /ssd/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++ > > $ clang --version > clang version 3.4 (trunk 192869) > Target: x86_64-unknown-linux-gnu > Thread model: posix > > $ clang++ --version > clang version 3.4 (trunk 192869) > Target: x86_64-unknown-linux-gnu > Thread model: posix > > $ echo $CC $CXX > clang clang++ > > $ cd ~/skia/trunk; rm -rf out/ > > $ ./gyp_skia && ninja -C out/Debug && ninja -C out/Release && echo ok > Updating projects from gyp files... > ninja: Entering directory `out/Debug' > 100% STAMP obj/gyp/most.actions_depends.stamp > ninja: Entering directory `out/Release' > 100% STAMP obj/gyp/most.actions_depends.stamp > ok > > No warnings! Are you doing anything different than me? Almost the same. The difference is that I ran 'gclient sync'. It says libwebp is at 3fe91635df8734b23f3c1b9d1f0c4fa8cfaf4e39. May be that is why you aren't seeing this error?
On 2013/10/28 21:16:53, tfarina wrote: > On 2013/10/28 20:05:53, mtklein wrote: > > On 2013/10/28 19:49:11, tfarina wrote: > > > https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp > > > File gyp/libwebp.gyp (right): > > > > > > > https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp#newcode18 > > > gyp/libwebp.gyp:18: 'cflags!': [ '-Wno-unused-const-variable', ], > > > On 2013/10/28 19:37:37, mtklein wrote: > > > > Try removing the "!"? That means "remove this", doesn't it? > > > I tried both ways, with and without. It doesn't work either. > > > That is frustrating! I uploaded the version without "!" in patch set 3. > PTAL. > > > > Huh, I'd love to help but I can't reproduce the problem. Here's what I'm > doing, > > again 64-bit Linux: > > > > $ which clang > > /ssd/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang > > > > $ which clang++ > > /ssd/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++ > > > > $ clang --version > > clang version 3.4 (trunk 192869) > > Target: x86_64-unknown-linux-gnu > > Thread model: posix > > > > $ clang++ --version > > clang version 3.4 (trunk 192869) > > Target: x86_64-unknown-linux-gnu > > Thread model: posix > > > > $ echo $CC $CXX > > clang clang++ > > > > $ cd ~/skia/trunk; rm -rf out/ > > > > $ ./gyp_skia && ninja -C out/Debug && ninja -C out/Release && echo ok > > Updating projects from gyp files... > > ninja: Entering directory `out/Debug' > > 100% STAMP obj/gyp/most.actions_depends.stamp > > ninja: Entering directory `out/Release' > > 100% STAMP obj/gyp/most.actions_depends.stamp > > ok > > > > No warnings! Are you doing anything different than me? > > Almost the same. The difference is that I ran 'gclient sync'. > > It says libwebp is at 3fe91635df8734b23f3c1b9d1f0c4fa8cfaf4e39. > > May be that is why you aren't seeing this error? Reproduced and fixed! Please take a look at patch set 4. (Obviously, it LGTM.)
On 2013/10/28 21:30:27, mtklein wrote: > On 2013/10/28 21:16:53, tfarina wrote: > > On 2013/10/28 20:05:53, mtklein wrote: > > > On 2013/10/28 19:49:11, tfarina wrote: > > > > https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp > > > > File gyp/libwebp.gyp (right): > > > > > > > > > > https://codereview.chromium.org/47603012/diff/70001/gyp/libwebp.gyp#newcode18 > > > > gyp/libwebp.gyp:18: 'cflags!': [ '-Wno-unused-const-variable', ], > > > > On 2013/10/28 19:37:37, mtklein wrote: > > > > > Try removing the "!"? That means "remove this", doesn't it? > > > > I tried both ways, with and without. It doesn't work either. > > > > That is frustrating! I uploaded the version without "!" in patch set 3. > > PTAL. > > > > > > Huh, I'd love to help but I can't reproduce the problem. Here's what I'm > > doing, > > > again 64-bit Linux: > > > > > > $ which clang > > > /ssd/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang > > > > > > $ which clang++ > > > /ssd/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++ > > > > > > $ clang --version > > > clang version 3.4 (trunk 192869) > > > Target: x86_64-unknown-linux-gnu > > > Thread model: posix > > > > > > $ clang++ --version > > > clang version 3.4 (trunk 192869) > > > Target: x86_64-unknown-linux-gnu > > > Thread model: posix > > > > > > $ echo $CC $CXX > > > clang clang++ > > > > > > $ cd ~/skia/trunk; rm -rf out/ > > > > > > $ ./gyp_skia && ninja -C out/Debug && ninja -C out/Release && echo ok > > > Updating projects from gyp files... > > > ninja: Entering directory `out/Debug' > > > 100% STAMP obj/gyp/most.actions_depends.stamp > > > ninja: Entering directory `out/Release' > > > 100% STAMP obj/gyp/most.actions_depends.stamp > > > ok > > > > > > No warnings! Are you doing anything different than me? > > > > Almost the same. The difference is that I ran 'gclient sync'. > > > > It says libwebp is at 3fe91635df8734b23f3c1b9d1f0c4fa8cfaf4e39. > > > > May be that is why you aren't seeing this error? > > Reproduced and fixed! Please take a look at patch set 4. (Obviously, it LGTM.) Thanks Mike! Pushing to CQ!
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/tfarina@chromium.org/47603012/190001
(Is this gyp file used for anything? Can the warning be fixed, instead of suppressed?)
On 2013/10/28 22:00:08, Nico wrote: > (Is this gyp file used for anything? Can the warning be fixed, instead of > suppressed?) It's used for building libwebp for Skia when we're not using the system webp (e.g outside Chrome,Android). The warning can be fixed by commenting out the unused array kCoeffThresh[16], or I guess asking skal@ to do his TODO and turn it back on.
Message was sent while issue was closed.
Change committed as 11990 |