Where is stdbool.h?

后端 未结 6 1864
温柔的废话
温柔的废话 2020-12-28 15:42

I want to find the _Bool definition on my system, so for systems where it\'s missing I can implement it. I\'ve seen various definitions for it here and on other

6条回答
  •  感情败类
    2020-12-28 16:36

    $ echo '_Bool a;' | gcc -c -x c -
    $ echo $?
    0
    
    $ echo 'bool a;' | gcc -x c -c -
    :1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘a’
    

    This demonstrates that _Bool is a built-in type and bool is not, by compiling a single variable declaration with no includes.

提交回复
热议问题