cancel
Showing results for 
Search instead for 
Did you mean: 

Booleans not showing up if C++ "bool" is used

MFran.4
Senior

Hello again, I know i posted some time ago but my question is not seen anymore (link to original https://community.st.com/s/question/0D53W00000wWDX2SAO/cubemonitor-still-not-seeing-boolean-values)

I was suggested to to include "stdbool.h" but, as I'm working with a C++ project, G++ says that bool is supported and what I get in "stdbool.h" is the following (italic is greyed out code):

#ifndef __cplusplus

#define bool   _Bool

#define true   1

#define false   0

#else /* __cplusplus */

/* Supporting _Bool in C++ is a GCC extension. */

#define _Bool   bool

#if __cplusplus < 201103L

/* Defining these macros in C++98 is a GCC extension. */

#define bool   bool

#define false   false

#define true   true

#endif

#endif /* __cplusplus */

I could manually modify the file to use "C" bool but, is there another way?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Richard.Chvr
ST Employee

No update since a while, closing the post.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
MFran.4
Senior

Is someone there?

MFran.4
Senior

Helloooo?

Pavel A.
Evangelist III

So, is your source file C or C++? If C++ then just do not include stdbool.h, as you already have bool ?

Mainly c++ files.

As i wrote, if i include stdbool it won't use stdbool's bool, but c++ bool!

These lines are greyed out:

#ifndef __cplusplus

#define bool   _Bool

#define true   1

#define false   0

And i think cubeMonitor wants that type of bool above, not what i have as active code in the file.

/* Supporting _Bool in C++ is a GCC extension. */

#define _Bool   bool

Richard.Chvr
ST Employee

No update since a while, closing the post.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Please stop churning up years old stale content and awarding yourself the best answer.

Just close the threads quitely/transparently so they don't bubble up as new content/posts.

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..