Bug #59080 Stray semicolon in header file my_sys.h causes build error.

Submitted: 21 Dec 2010 6:22 Modified: 6 Jan 2011 17:36
Reporter: Dave Kelly Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / C Severity:S2 (Serious)
Version:6.0.2 GA OS:Windows
Assigned to: CPU Architecture:Any
Tags: build error, header, includes, my_sys.h, regression, semicolon, syntax error

[21 Dec 2010 6:22] Dave Kelly
Description:
There is a syntax error on line 44 in the include/my_sys.h header file; the problem code is as follows:

#define MY_INIT(name); { my_progname= name; my_init(); }

Note the errant semicolon immediately after MY_INIT(name).  This breaks the macro definition for the MY_INIT(name) macro function and causes a build error during compile.

How to repeat:
Try to use the Connector/C headers and libraries in a program build.

Suggested fix:
Change line 44 of the include/my_sys.h header file to read as follows:

#define MY_INIT(name) { my_progname = name; my_init(); }

In other words, remove the semicolon that immediately followed after MY_INIT(name).

Afterward, recompile and relink the object libraries (in the lib folder) that are included in the Connector download.
[21 Dec 2010 11:07] Valeriy Kravchuk
Thank you for the bug report. Verified by code review.
[21 Dec 2010 17:45] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/127458

2920 Georg Richter	2010-12-21
      Fix for bug #59080 (Stray semicolon in header file my_sys.h causes build error)
[21 Dec 2010 17:51] Georg Richter
Fixed in revision 2920
Bug fix will appear in 6.0.3
[6 Jan 2011 17:36] Tony Bedford
An entry has been added to the 6.0.3 changelog:

There was a syntax error on line 44 of the include/my_sys.h header file. The problem code was:

#define MY_INIT(name); { my_progname= name; my_init(); }

The semicolon immediately after MY_INIT(name) was incorrect. This broke the macro definition for the MY_INIT(name) macro function and caused a build error during compile.

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

Page generated in 0.055 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.