typedef char bool;
doesn’t work (Edit: it doesn’t compile for “fatal error C1004: unexpected end-of-file found”, not just about inference by Intellisense). Reason I assume is that bool is one of the reserved keywords in Microsoft Visual C/C++. Since I need boolean type of literal name as exact “bool” (That means, type names other than bool, such as
boolean
BOOLEAN
BOOL
Bool
...
are not allowed), is there a compiling option perhaps I can use to override the keyword “bool” which is NOT in ANSI C(ISO/IEC-9899:1990) Microsoft Visual C/C++ complies with?
NB: THIS IS NOT ABOUT C++ or VISUAL C++ AT ALL. IT’S ABOUT PROGRAMMING IN ANSI C 90 WITH MSVC COMPILER IN COMPATIBLE MODE.
Thanks in advance.
Supplementary
Compiling option: /TC /Za
/* ANSI C file main.c */
typedef char bool;
int main(int argc, char * argv[])
{
return 0;
}
(Edit: This problem has been figured out. For this case – typedef char bool – in terms of ANSI C, one can’t disable Microsoft language extension by setting /Za option to work around, though Microsoft suggests the opposite. Such incoherence might be treated as a potential bug in Visual Studio 2012 RC)
There is an option for the the file where you can choose what type to compile as (you can choose C or C++)
Also, have you tried stdbool.h