Bug #88041 Avoid C++ comments in mysql C headers

Submitted: 10 Oct 2017 7:31 Modified: 12 Oct 2017 9:57
Reporter: Sebastien FLAESCH Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version:8.0.3 OS:Any
Assigned to: CPU Architecture:Any
Tags: C++, comments, compiler, header, libmysqlclient, warnings

[10 Oct 2017 7:31] Sebastien FLAESCH
Description:
The C headers in include directory contain C++ style comments with //

When compiling with gcc -Wall -Werror to make sure that any mistake stops the compilation of our C code.

When including MySQL C headers we get:

...... error: C++ style comments are not allowed in ISO C90 [-Werror]

Can you please use only C style comments in .h headers, designed for C code?

Thanks.

How to repeat:
Compile with gcc -Wall -Werror

Suggested fix:
Remplace // comments by /*  */ comments
[10 Oct 2017 8:18] MySQL Verification Team
Hello Sebastien FLAESCH,

Thank you for the report and feedback!

Thanks,
Umesh
[12 Oct 2017 9:28] MySQL Verification Team
Hello Sebastien,

We have discussed internally on this and concluded that - Since MySQL 8.0, the client headers require C99 or newer, which allows // comments. GCC uses C11 mode by default since version 5. If you must use an older version of GCC, you can use the default gnu89 mode without -pedantic,which also accepts such comments.

Thank you for your interest in MySQL.

Thanks,
Umesh
[12 Oct 2017 9:57] Sebastien FLAESCH
Ok I understand.
Thanks for the answer and suggestion.
Seb

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.