prasannap5 / snappy

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

snappy.cc emits signed vs. unsigned comparison warning on MSVC #95

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Compiling snappy.cc with MSVC produces warning C4018 for comparing signed and 
unsigned quantities.  This is because a few places use int instead of size_t.  
It turns out we really want to just use size_t in these places anyway because 
we use size_t already in related code.

Attached is a patch to fix this error, which applies against Chromium's current 
copy of snappy.  It looks to me as if this should also cleanly apply upstream.

Original issue reported on code.google.com by pkasting@chromium.org on 21 Jul 2015 at 7:18

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

The version on Google Code is no longer updated. Have you tried the GitHub 
version? I applied some patches for MSVC there recently.

Original comment by se...@google.com on 21 Jul 2015 at 7:30

GoogleCodeExporter commented 9 years ago
These problems are still identically present in that version, and the patch 
should still apply there (perhaps with a small offset).

Would you like me to post this patch elsewhere or do something else to aid its 
being landed?

Original comment by pkasting@chromium.org on 21 Jul 2015 at 7:41

GoogleCodeExporter commented 9 years ago
Hm, so 
https://github.com/google/snappy/commit/b2ad96006741d40935db2f73194a3e489b467338
 wasn't enough? Perhaps that's the unit test only...

Anyway, the simplest thing to do if you're internal to Google (which I assume 
from the @chromium.org address?) is to send a code review against 
//third_party/zippy. But I'm on vacation, so there will be a few weeks before I 
can reply. You can send it to someone else, though; there are multiple owners.

Original comment by se...@google.com on 21 Jul 2015 at 8:24

GoogleCodeExporter commented 9 years ago
Done internally.  CL number 98768263, sent to sanjay.  Let me know if that's 
not right.

Feel free to either close this or update it as appropriate.

Original comment by pkasting@chromium.org on 21 Jul 2015 at 8:41

GoogleCodeExporter commented 9 years ago
I was on vacation but returned today and pushed your change out to GitHub:

https://github.com/google/snappy/commit/d80342922cd7fa16f6b42a2d7aa9d234adcaecdd

Thanks! Closing this bug.

Original comment by se...@google.com on 3 Aug 2015 at 11:18