Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions components/libc/posix/io/stdio/stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ int rt_posix_stdio_set_console(const char* device_name, int mode)
_GLOBAL_REENT->_stderr = std_console;
}

#if (NEWLIB_VERSION_NUM < 30400U) || (NEWLIB_VERSION_NUM >= 40000U && NEWLIB_VERSION_NUM < 40300U)
_GLOBAL_REENT->__sdidinit = 1; /* __sdidinit is obselete */
#if defined(_REENT_SMALL) || !defined(__sdidinit)
// Newlib >= 3.4.0 or small reent version: no __sdidinit field
// Do nothing
#else
// Older newlib versions (typically < 3.4.0) still define __sdidinit
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English: The comment style should follow RT-Thread coding standards using C-style comments (/* */) instead of C++-style comments (//) for consistency with the existing codebase.\n\n中文: 注释风格应遵循 RT-Thread 编码标准,使用 C 风格注释(/* */)而不是 C++ 风格注释(//),以与现有代码库保持一致。

Suggested change
// Newlib >= 3.4.0 or small reent version: no __sdidinit field
// Do nothing
#else
// Older newlib versions (typically < 3.4.0) still define __sdidinit
/* Newlib >= 3.4.0 or small reent version: no __sdidinit field */
/* Do nothing */
#else
/* Older newlib versions (typically < 3.4.0) still define __sdidinit */

Copilot uses AI. Check for mistakes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个麻烦作者修改下

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

_GLOBAL_REENT->__sdidinit = 1;
#endif
}

Expand Down