Alex Rivera | Logout

Where is stdbool.h?

Asked 2009-11-01T10:59:56.370
28

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 sites, but wanted to check on the system for the definitive definition.

Slight problem, in that I can't find where _Bool is defined or even stdbool.h

mussys@debmus:~$ find /usr/include/* -name stdbool.h
/usr/include/c++/4.3/tr1/stdbool.h

And grep for _Bool on /usr/include/* and /usr/include/*/* does not find it either.

So where is it?

Edit
Report

1 Answer

17

_Bool is a built-in type, so don't expect to find a definition for it in a header file, even a system header file.

Having said that, guessing your system from the paths that you are searching, have you looked in /usr/lib/gcc/*/*/include ?

My "real" stdbool.h lives there. As expected it #defines bool to be _Bool. As _Bool is a type native to the compiler there's no definition for it in the header file.

answered 2009-11-01T11:06:33.750

Your Answer