New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix -Wsign-conversion
issues
#2170
Conversation
This patch looks a lot better. Thank you. |
Thanks for the feedback @EricWF! I’ll force-push my newer revision soon which touches more areas affected by this warning. |
d453575
to
b81db4e
Compare
-Wsign-conversion
issues (version 2)-Wsign-conversion
issues
I've addressed the remaining issues via casting, etc. Please feel free to review! |
b81db4e
to
e9a5bfb
Compare
@gennadiycivil: ping? |
I see there are issues I need to resolve before this can be merged. |
92c1238
to
55f2d3a
Compare
@EricWF, @gennadiycivil: I fixed the issues, so CI once again passes on this branch (and I fixed some issues with incoming code as well in the past few days). Please re-review this PR. Thank you! |
55f2d3a
to
f8d6379
Compare
And I broke it by accident with a force push.. I will unbreak it again soon. |
f8d6379
to
fb1efef
Compare
Ok. Force pushed the right set of changes. |
fb1efef
to
3829b84
Compare
@EricWF, @gennadiycivil: ready for review! |
Ping? |
@EricWF, @gennadiycivil: ping? |
@gennadiycivil: ping? |
Looking, sorry for the delay |
b262124
to
243f815
Compare
Cast some values as their unsigned equivalents or `size_t` to match the parameter type used for the template object under test. Also, provide UInt32 equivalent delegate methods for some callers (with int-equivalents for backwards compatibility). This closes google#2146. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
243f815
to
9358a33
Compare
I'm trying again after rebasing. It seems that other changes have snuck in, in the past week, which are triggering failures on Linux >_>. |
@gennadiycivil: ok. CI is green again with the latest set of pushed changes. |
PiperOrigin-RevId: 244069956
We had an internal review and made small-ish changes, mostly formatting and trivial. I imported this PR before your latest commit so your latest changes are not here. The most expedient would be to make another PR to pick up the changes that could have been missed. Thank you |
just try to compile google test a0d60be with clang 7.0.1 [ 1%] Building CXX object googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.obj |
On Apr 18, 2019, at 11:20, elcabesa ***@***.***> wrote:
just try to compile google test a0d60be with clang 7.0.1
this is the error coming out from cmake:
[ 1%] Building CXX object googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.obj
In file included from C:\Users\elcab\Downloads\workspace\vajolet22\build\googletest-src\googletest\src\gtest-all.cc:41:
C:/Users/elcab/Downloads/workspace/vajolet22/build/googletest-src/googletest\src/gtest.cc:1694:43: error: implicit
conversion changes signedness: 'long' to 'DWORD' (aka 'unsigned long') [-Werror,-Wsign-conversion]
hr, // the error
^~
In file included from C:\Users\elcab\Downloads\workspace\vajolet22\build\googletest-src\googletest\src\gtest-all.cc:45:
C:/Users/elcab/Downloads/workspace/vajolet22/build/googletest-src/googletest\src/gtest-port.cc:282:11: error: implicit
conversion changes signedness: 'int' to 'DWORD' (aka 'unsigned long') [-Werror,-Wsign-conversion]
::Sleep(n);
~~ ^
In file included from C:\Users\elcab\Downloads\workspace\vajolet22\build\googletest-src\googletest\src\gtest-all.cc:46:
C:/Users/elcab/Downloads/workspace/vajolet22/build/googletest-src/googletest\src/gtest-printers.cc:179:28: error:
implicit conversion changes signedness: 'signed char' to 'wchar_t' [-Werror,-Wsign-conversion]
if (IsPrintableAscii(c)) {
~~~~~~~~~~~~~~~~ ^
C:/Users/elcab/Downloads/workspace/vajolet22/build/googletest-src/googletest\src/gtest-printers.cc:223:29: note: in
instantiation of function template specialization 'testing::internal::PrintAsCharLiteralTo<unsigned char, signed
char>' requested here
const CharFormat format = PrintAsCharLiteralTo(c, os);
^
C:/Users/elcab/Downloads/workspace/vajolet22/build/googletest-src/googletest\src/gtest-printers.cc:248:3: note: in
instantiation of function template specialization 'testing::internal::PrintCharAndCodeTo<unsigned char, signed
char>' requested here
PrintCharAndCodeTo(c, os);
^
3 errors generated.
mingw32-make[2]: *** [googletest-build\googletest\CMakeFiles\gtest.dir\build.make:63: googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:110: googletest-build/googletest/CMakeFiles/gtest.dir/all] Error 2
mingw32-make: *** [Makefile:129: all] Error 2
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
I’ll send you a patch later on today/tomorrow to fix this (I will need to fire up my windows 10 machine, install the necessary tools, etc). I’m a bit (but not completely) surprised someone is compiling googletest in Cygwin with clang :)..
Thanks for the report!
-Enji
|
Broke my Emscripten build I think:
|
This PR takes a different approach by tackling individuals issues without changing internal API construction, as I tried in #2165.
This makes googletest compile cleanly with
clang++ -Wconversion
, fixing #2146.