Bug #93475 legacy bool definition in xapi.h
Submitted: 4 Dec 2018 20:18 Modified: 3 Jan 19:04
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Verified Impact on me:
Category:Connector / C++ Severity:S4 (Feature request)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any
Triage: Needs Triage: D5 (Feature request)

[4 Dec 2018 20:18] Daniël van Eeden
From /usr/include/mysql-cppconn-8/mysqlx/xapi.h: 
  97 #ifndef __cplusplus
  98   typedef unsigned char bool;
  99 #endif

This can cause issues where xapi.h is imported after other headers that already define bool.

How to repeat:
Import xapi.h in a project that already defines bool.

Suggested fix:
Use stdbool.h
[6 Dec 2018 6:38] Umesh Shastry
Hello Daniël,

Thank you for the report!

[6 Dec 2018 8:12] Daniël van Eeden
In my Perl::XS based project I can't use clang-format because of this as it reorders the includes.
[11 Dec 2018 14:27] Rafal Somla
Posted by developer:
Hi Daniel. In your use scenarios you get conflict with typedef or #define? We'll think how to best deal with that - getting public headers right is a tricky business as you know. If you have any suggestions please shoot.
[3 Jan 19:04] Daniël van Eeden
A possible fix is in:
Bug #93803 	Contribution: Use stdbool.h instead typedef for bool