RFR: JDK-8331732 : [PPC64] Unify and optimize code which converts != 0 to 1 [v17]
Suchismith Roy
sroy at openjdk.org
Sat Jun 29 06:47:52 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!!!
Maybe this needs to be enforced during build then ? @offamitkumar
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19886#discussion_r1659635447
More information about the hotspot-dev
mailing list