Bug #85907 mysql.h includes my_config.h
Submitted: 11 Apr 2017 21:51 Modified: 15 May 2017 8:44
Reporter: Alexey Kopytov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version:8.0.1 OS:Any
Assigned to: CPU Architecture:Any

[11 Apr 2017 21:51] Alexey Kopytov
Description:
I'm building sysbench with 8.0.1 client libraries and seeing warnings
like these:

---
In file included from drv_mysql.c:37:
In file included from /usr/local/mysql/include/mysql.h:71:
In file included from /usr/local/mysql/include/mysql_com.h:29:
In file included from /usr/local/mysql/include/my_inttypes.h:25:
/usr/local/mysql/include/my_config.h:316:9: warning: 'PACKAGE' macro redefined [-Wmacro-redefined]
#define PACKAGE "mysql"
        ^
../../../config/config.h:185:9: note: previous definition is here
#define PACKAGE "sysbench"
        ^
In file included from drv_mysql.c:37:
In file included from /usr/local/mysql/include/mysql.h:71:
In file included from /usr/local/mysql/include/mysql_com.h:29:
In file included from /usr/local/mysql/include/my_inttypes.h:25:
/usr/local/mysql/include/my_config.h:317:9: warning: 'PACKAGE_BUGREPORT' macro redefined [-Wmacro-redefined]
#define PACKAGE_BUGREPORT ""
        ^
---

The sysbench source code does indeed have a header defining PACKAGE,
PACKAGE_BUGREPORT, etc. The reasons those defines now conflict with
mysql.h is that after header files refactoring in 8.0.1 mysql.h now
includes my_config.h via my_inttypes.h.

I'm not sure that's an intended behavior.

How to repeat:
Try to build any client C applications defining the standard PACKAGE* autoconf defines.
[12 Apr 2017 7:11] MySQL Verification Team
Hello Alexey,

Thank you for the report.
I'm not sure whether this is intended behavior but observed while compiling sysbench with 8.0.1 client libraries.

Thanks,
Umesh
[12 Apr 2017 7:12] MySQL Verification Team
Build details..

Attachment: 85907.build_details (application/octet-stream, text), 194.14 KiB.

[13 Apr 2017 16:07] Terje Røsten
Hi Alexey!

Thanks for your report. This is working in progress, thanks for testing!

Next 8.0.x release will probably include change to remove
coupling between mysql.h and my_inttypes.h and this problem will go away.
[27 Apr 2017 16:42] Terje Røsten
Hi again,

can you please try Unified Data Directory release available from Labs?

 https://labs.mysql.com/

I think a fix is included there, it's preview of things in 8.0.2.
[14 May 2017 16:20] Alexey Kopytov
Hi Terje,

I confirm, this is fixed in the Unified Data Directory Labs release. Thank you.
[15 May 2017 8:44] Terje Røsten
Fixed in 8.0.2 by commit:
 Bug #25604230 DO NOT INCLUDE MY_INTTYPES.H FROM MYSQL.H