本文介绍了错误:内置功能"tolower"的类型冲突[-Werror]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个不使用glibc
的小型RTOS,并且我已经在字符串中编写了自己的函数(例如tolower
).c
I have a small RTOS which does not use glibc
and I have written own functions (e.g. tolower
) in string.c
编译时出现错误:
common/string.c:11:6: error: conflicting types for built-in function ‘tolower’ [-Werror]
有CFLAGS来解决这个问题吗?
Is there a CFLAGS to fix this?
更新答案:使用-fno-builtin
Update Answer: use -fno-builtin
推荐答案
tolower
是C库中的函数,并且其标识符是保留的标识符,可以用作带有外部链接的标识符,即使您不包括在内声明它的标题.
tolower
is a function from the C library and its identifier is a reserved identifier for use as an identifier with external linkage, even if you don't include the header where it is declared.
您可以使用-fno-builtin
摆脱警告,但最好的办法只是为tolower
选择另一个名称.
You could get rid of the warning by using -fno-builtin
but the best is simply to chose another name for tolower
.
这篇关于错误:内置功能"tolower"的类型冲突[-Werror]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!