Skip to content
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

[bug] gcc默认模板中的--specs=nano.specs应该同时也被设置为c/c++编译器标志 #259

Closed
yyjdelete opened this issue Jun 3, 2023 · 1 comment

Comments

@yyjdelete
Copy link

在c/c++编译器标志中指定--specs=nano.specs时会导致引用路径中arm-none-eabi\include\newlib.h被替换为arm-none-eabi\include\newlib-nano\newlib.h, 从而导致部分结构体定义发生改变
例如下面这段代码, 在nano.specs下返回76, 未指定时返回288(依具体的gcc版本而定)

编译FreeRTOS中如果将配置中的configUSE_NEWLIB_REENTRANT改为1就会遇到这个问题
由于程序编译时采用的定义和连接到的C库中的实际实现不一致, 从而引起连接错误或者执行时随机出错(依具体的gcc版本而定)

#include <reent.h>

    printf("sizeof(struct _reent): %d\n", sizeof(struct _reent));
@github0null
Copy link
Owner

好的,后面会对这些默认参数进行修补

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants