RFR: 8323820: [MacOS] build failure: non-void function does not return a value [v2]

Joshua Cao duke at openjdk.org
Tue Jan 16 18:47:35 UTC 2024


On Tue, 16 Jan 2024 18:37:02 GMT, Lutz Schmidt <lucy at openjdk.org> wrote:

>> src/hotspot/share/opto/castnode.cpp line 470:
>> 
>>> 468:     return new CastPPNode(c, in, type, dependency, types);
>>> 469:   }
>>> 470:   ShouldNotReachHere();
>> 
>> Keep the `fatal` with the message, and just add `return`?
>
> `return nullptr;`
> does not create an issue with Xcode 15. Could have been an issue because if Xcode15 recognizes `fatal()` as a `noreturn` function, it could report the `return` as not reachable.
> 
> `fatal()` vs. `ShouldNotReachHere()`
> Which one creates more helpful debug information?
> I'm fine with either one. I will review once decided. 
> 
> Xcode 12 <-> clang 12
> Xcode 13 <-> clang 13

Sure, changed it back to `fatal()`. Don't have strong preferences, and not sure what is best practices.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17449#discussion_r1453853918


More information about the hotspot-compiler-dev mailing list