Skip to content

Fix MSVC warnings in crc32c_unittest.cc - #3

Merged
cmumford merged 1 commit into
masterfrom
win
Aug 31, 2017
Merged

cmumford merged 1 commit into
masterfrom
win

Conversation

@pwnall

@pwnall pwnall commented Aug 31, 2017

Copy link
Copy Markdown
Contributor

This also modifies the CMake configuration, so relevant build targets will be compiled with /WX (warnings-as-errors) on MSVC. This should help us catch similar errors in CI in the future.

This fixes the compile errors in https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.win%2FWin_x64_Builder__dbg_%2F57719%2F%2B%2Frecipes%2Fsteps%2Fcompile%2F0%2Fstdout

@pwnall
pwnall requested a review from cmumford August 31, 2017 16:14
Comment thread src/crc32c_unittest.cc Outdated

for (size_t i = 0; i < 32; ++i)
buf[i] = static_cast<char>(0xff);
buf[i] = static_cast<char>(-1); // 0xff causes warning C4309 on MSVC.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about?

buf[i] = '\xff'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Sweet, I didn't think about that! Thanks!

This also modifies the CMake configuration, so relevant build targets
will be compiled with /WX (warnings-as-errors) on MSVC. This should help
us catch similar errors in CI in the future.
@pwnall

pwnall commented Aug 31, 2017

Copy link
Copy Markdown
Contributor Author

@cmumford Thank you for the quick review! PTAL?

@cmumford cmumford closed this Aug 31, 2017
@cmumford cmumford reopened this Aug 31, 2017
@cmumford
cmumford merged commit db73a3f into master Aug 31, 2017
@pwnall
pwnall deleted the win branch August 31, 2017 19:32
@pwnall

pwnall commented Aug 31, 2017

Copy link
Copy Markdown
Contributor Author

@cmumford Thank you very much for the quick turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants