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.