error: conflicting types for built-in function ‘tolower’ [-Werror]

后端 未结 2 624
渐次进展
渐次进展 2021-01-20 10:26

I have a small RTOS which does not use glibc and I have written own functions (e.g. tolower) in string.c

When compiling I am getting the er

2条回答
  •  独厮守ぢ
    2021-01-20 11:05

    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.

    You could get rid of the warning by using -fno-builtin but the best is simply to chose another name for 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."

提交回复
热议问题