Commit d2507dcc authored by Allan Blanchard's avatar Allan Blanchard
Browse files

Merge branch 'fix/libc/stdbool' into 'master'

[libc] ensure bool, true and false are not macros when in C++ mode

See merge request frama-c/frama-c!3093
parents 3bcbfc21 c5d2f11e
......@@ -22,8 +22,11 @@
#ifndef __FC_STDBOOL
#define __FC_STDBOOL
// In C++, bool, true and false are native values
#ifndef __cplusplus
#define bool _Bool
#define true 1
#define false 0
#endif
#define __bool_true_false_are_defined 1
#endif
[kernel] Parsing tests/libc/stdbool_as_cpp.c (with preprocessing)
/* Generated by Frama-C */
int main(void)
{
int __retres;
__retres = 0;
return __retres;
}
/* run.config*
OPT: -print
*/
// announce that we are a non-conforming C++ compiler
#define __cplusplus 1L
#include <stdbool.h>
#ifdef bool
#error bool should not be defined in C++ mode
#endif
#ifdef true
#error true should not be defined in C++ mode
#endif
#ifdef false
#error false should not be defined in C++ mode
#endif
int main() { return 0; }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment