RFR: 8238284: [macos] Zero VM build fails due to an obvious typo

David Holmes david.holmes at oracle.com
Fri Jan 31 11:59:37 UTC 2020


Hi Jie,

On 31/01/2020 9:01 pm, jiefu(傅杰) wrote:
> Hi all,
> 
> JBS:    https://bugs.openjdk.java.net/browse/JDK-8238284
> Webrev: http://cr.openjdk.java.net/~jiefu/8238284/webrev.00/
> 
> Zero VM build is broken due to an obvious typo [1].
> 
> More errors can be triggered with clang 11, which can be fixed by adding `const`.
> ------------------------------------------
> /Users/fool/workspace/open/jdk/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp:369:8: error: conflicting types for '_Copy_conjoint_jshorts_atomic'
>    void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
>         ^
> /Users/fool/workspace/open/jdk/src/hotspot/share/utilities/copy.hpp:47:8: note: previous declaration is here
>    void _Copy_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count);
>         ^
> ...
> 
> /Users/fool/workspace/open/jdk/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp:371:15: error: cannot initialize a variable of type 'jshort *' (aka 'short *') with an rvalue of type 'const jshort *' (aka 'const short *')
>        jshort *end = from + count;
>                ^     ~~~~~~~~~~~~
> ...
> ------------------------------------------
> 
> Could you please review it and give me some advice?

Those fixes all look obviously correct.

I note however that the same problem regarding lack of const exists in 
other zero implementations. Should they also be fixed?

Thanks,
David

> Thanks a lot.
> Best regards,
> Jie
> 
> [1] http://hg.openjdk.java.net/jdk/jdk/file/0905868db490/src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp#l192
> 


More information about the hotspot-dev mailing list