Skip to content
Snippets Groups Projects
Commit c5d2f11e authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

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

parent 39ae9d57
No related branches found
No related tags found
No related merge requests found
......@@ -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; }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment