Skip to content

[libc][newlib] __sdidinit is obselete #7958

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
6 changes: 5 additions & 1 deletion components/libc/posix/io/stdio/libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ INIT_ENV_EXPORT(libc_system_init);

#if defined(RT_USING_POSIX_STDIO) && defined(RT_USING_NEWLIBC)

#define NEWLIB_VERSION_NUM (__NEWLIB__ * 10000U + __NEWLIB_MINOR__ * 100U + __NEWLIB_PATCHLEVEL__)

static FILE* std_console = NULL;
int libc_stdio_set_console(const char* device_name, int mode)
{
Expand Down Expand Up @@ -102,7 +104,9 @@ int libc_stdio_set_console(const char* device_name, int mode)
_GLOBAL_REENT->_stderr = std_console;
}

_GLOBAL_REENT->__sdidinit = 1;
#if (NEWLIB_VERSION_NUM < 30400U) || (NEWLIB_VERSION_NUM >= 40000U && NEWLIB_VERSION_NUM < 40300U)
_GLOBAL_REENT->__sdidinit = 1; /* __sdidinit is obselete */
Copy link
Member

Choose a reason for hiding this comment

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

当前文件感觉是通用的文件,如果这个变量是由newlib里有的话,是不是应该放到newlib的对接文件里。

#endif
}

if (std_console)
Expand Down