我有一个不使用 glibc
的小型 RTOS,我在 string.c 中编写了自己的函数(例如 tolower
)
编译时出现错误:
common/string.c:11:6: error: conflicting types for built-in function ‘tolower’ [-Werror]
是否有 CFLAGS 来解决这个问题?
更新答案:使用-fno-builtin
最佳答案
tolower
是 C 库中的一个函数,它的标识符是一个保留标识符,用作具有外部链接的标识符,即使您不在声明它的地方包含 header 也是如此。
您可以使用 -fno-builtin
来消除警告,但最好的方法是为 tolower
选择另一个名称。
(C99, 7.1.3p1) "All identifiers with external linkage in any of the following subclauses (including the future library directions) are always reserved for use as identifiers with external linkage."
关于c - 错误 : conflicting types for built-in function ‘tolower’ [-Werror],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20582536/