-
Notifications
You must be signed in to change notification settings - Fork 15
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
编译过程中的warning整理 #164
Comments
主要warning分类: comparison of unsigned expression in 'xxx' is always true [-Wtype-limits]
#warning "SYS_clock_getres not defined for this platform, disabling fast_thread_cpu_time" [-Wcpp]
no return statement in function returning non-void [-Wreturn-type]
cast between incompatible function types from 'xxx' to 'xxx' [-Wcast-function-type]
'xxx' clearing an object of non-trivial type 'xxx'; use assignment or value-initialization instead [-Wclass-memaccess]
'xxx' writing to an object of type 'xxx' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
'xxx' moving an object of non-trivially copyable type 'xxx'; use 'new' and 'delete' instead [-Wclass-memaccess]
|
[-Wtype-limits]上述示例中的变量 |
我在本地验证的Log,似乎比 @DingliZhang 整理出来的还要多一些Log,先保存一份,后续可以用来更新warning列表。 |
[-Wclass-memaccess]这类主要是 GCC 8+版本会在使用memcpy/memcpy 等操作类指针 ( -Wclass-memaccess)弹出warning,可以通过将目标指针强制转换为void*来避免警告。 |
关于“src/hotspot/os/linux/os_linux.cpp:1356:6: warning: #warning "SYS_clock_getres not defined for this platform, disabling fast_thread_cpu_time" [-Wcpp] 发现最后的编译过程中,都没有出现“#warning”的相关打印,意味着“SYS_clock_getres”是被定义的。 关于“src/hotspot/os_cpu/linux_riscv32/atomic_linux_riscv32.hpp:115:76: warning: no return statement in function returning non-void [-Wreturn-type] 8.12更新关于“src/hotspot/os_cpu/linux_riscv32/atomic_linux_riscv32.hpp:115:76: warning: no return statement in function returning non-void [-Wreturn-type] 注释掉两个空模板以及对应函数的指针大小比较的判断即可消除warning
进一步分析:需要证明,在rv32的平台wide atomics need specialization是否需要保留,查阅了rv32的资料,目前没有发现相关的介绍,需要继续跟进。 在调用告警产生处新加warning 所以可以暂时消除这个告警,不会影响调试进程。 已提交#170,编译过程中相关warning已不再出现,jdk运行结果没有变化 |
[-Wcast-function-type]解决的时候参考了 openjdk@3870110 2021/08/12更新已提交PR #168,更新了 |
[-Wcpp]
由源码可以看出,这里报出warning的原因是
在Make time32 syscall numbers optional中,由于不希望新架构提供旧的 32 位基于 time_t 的系统调用或定义系统调用号宏,因此添加一个新的 __ARCH_WANT_TIME32_SYSCALLS宏,这个宏通常在 目前工具链的kernel版本为5.10.5,而upstream的kernel在5.10.57版本中为riscv添加了 所以这里并不是JDK源码导致的的warning,可以暂时通过在工具链的 |
编译的原始记录:make.log
pastebin:https://paste.ubuntu.com/p/HcKj6wx9rp/
The text was updated successfully, but these errors were encountered: