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

后端 未结 2 604
渐次进展
渐次进展 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 10:45

    If you're not using the C standard library for some reason, I won't tell you that's probably a bad idea. Even though the builtin function will probably implicitely link to a libc implementation under certain circumstances beyond your control.

    Anyways... Either don't use -Werror, or append -Wno-error or fix your function to look like the real thing:

    int tolower(int c);
    

提交回复
热议问题