RFR: JDK-8331732 : [PPC64] Unify and optimize code which converts != 0 to 1 [v17]

Suchismith Roy sroy at openjdk.org
Sat Jun 29 06:41:19 UTC 2024


On Sat, 29 Jun 2024 02:48:58 GMT, Amit Kumar <amitkumar at openjdk.org> wrote:

>> I think the 2nd value is taken at default.
>
> amitkumar at Amits-MacBook-Pro ~ % cat tt.cpp
> #include <iostream>
> using namespace std; 
> 
> void fun(int a, char b = 'a', float c = 10.3); 
> 
> int main(void) {
>   fun(10); 
>   fun(10, 103.483);
>   return 0;
> }
> 
> void fun(int a, char b, float c) {
> }
> 
> amitkumar at Amits-MacBook-Pro ~ % g++ tt.cpp 
> tt.cpp:8:11: warning: implicit conversion from 'double' to 'char' changes value from 103.483 to 103 [-Wliteral-conversion]
>   fun(10, 103.483);
>   ~~~     ^~~~~~~
> 1 warning generated.
> 
> 
> That's weird!!!

Yeah i am not sure why the warning did not pop up during build.It run through fine. Thanks for pointing it out. I will correct it.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19886#discussion_r1659631315


More information about the hotspot-dev mailing list