teasame / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

WebP source does not compile cleanly with full warnings on. #137

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Compile WebP with -Werror -Wshadow -Wconversions (I used clang version 4.1) and 
you will receive 100 + errors showing potential bad conversions, and shadowed 
variable names.

Original issue reported on code.google.com by dmaclach@chromium.org on 18 Jan 2013 at 6:24

GoogleCodeExporter commented 9 years ago
You don't really need clang, gcc -Wconversion can be used. visual studio can be 
configured to make this level of noise too.

Really these should be split; -Wshadow can be dealt with, while some of the 
conversion warnings are a bit spurious so some care will be needed so we don't 
impact readability too much.

Original comment by jz...@google.com on 19 Jan 2013 at 7:06

GoogleCodeExporter commented 9 years ago
i took care of the -Wshadow warnings at  
https://gerrit.chromium.org/gerrit/41720

They are overall pretty noisy, but manageable.

Conversion warnings are more a readability pain: for instance, the compiler
can't guess that VP8GetValue(br, 8) *will* return an uint8_t-compatible 8bit 
value. Having to cast all these doesn't bring much to the table. TODO(later).

Original comment by pascal.m...@gmail.com on 21 Jan 2013 at 4:23

GoogleCodeExporter commented 9 years ago
Could you not actually increase readability by defining VP8GetValue8, 
VP8GetValue16 and VP8GetValue32 that wrapped the casts and returned the 
appropriate types?

Original comment by dmaclach@chromium.org on 21 Jan 2013 at 8:10