Repository navigation
Conversation
picolibc declares the buffer as char[restrict static 26], so the pointer form warns with -Warray-parameter and the NULL check with -Wnonnull-compare. Other C libraries keep the pointer form. Signed-off-by: Parthiban Nallathambi <[email protected]>
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: componentsReviewers: @Maihuanyi Changed Files (Click to expand)
🏷️ Tag: components_libcReviewers: @GorrayLi @mysterywolf Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-11-07 04:43 CST)
📝 Review Instructions
|
|
BernardXiong
left a comment
There was a problem hiding this comment.
复核 head bb439460:CLA 已签署,CI 全部通过(106 pass)。picolibc 分支用 __restrict_arr __min_size(__ASCTIME_SIZE) 匹配 asctime_r / ctime_r 的原型,非 picolibc 分支保持原有 char * 签名不变;_ASCTIME_BUF_NULL() 在 picolibc 下返回 0,避免对非空指针做多余的 NULL 比较。未发现阻塞问题。
Reviewed head bb439460: CLA is signed and all checks pass (106 pass). The picolibc branch matches the asctime_r / ctime_r prototypes with __restrict_arr __min_size(__ASCTIME_SIZE), while the non-picolibc branch keeps the original char * signature. _ASCTIME_BUF_NULL() returning 0 under picolibc correctly avoids a redundant NULL comparison. No blocking issues found.
为什么提交这份PR (why to submit this PR)
With picolibc, ctime.c gives -Warray-parameter and -Wnonnull-compare warnings, so builds with --strict fail.
你的解决方案是什么 (what is your solution)
picolibc declares the buffer of asctime_r/ctime_r as char[static 26]. Use the same form only for picolibc and drop the NULL check there. Other C libraries are unchanged.
请提供验证的bsp和config (provide the config and bsp)
BSP: bsp/qemu-vexpress-a9 (newlib, musl), bsp/stm32/stm32f407-rt-spark (newlib), RH850 qemu-rh850-u2c (picolibc)
.config: default
action: YTD