Bug #23839 Multiple declarations of macros
Submitted: 1 Nov 2006 14:09 Modified: 12 Apr 2008 3:02
Reporter: Mike Lischke Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version:5.1.11 client library, 4.1 BK, 5.0 BK OS:Any (any)
Assigned to: Iggy Galarza CPU Architecture:Any

[1 Nov 2006 14:09] Mike Lischke
Description:
There are many macros like int3store, floatget etc. declared twice for (non-64bit) Windows. They are declared in my_global.h and config-win.h. Even worse is that they are declared syntactically different although they are semantically identical. These redeclarations cause tons of warnings when compiling hiding so the real problems.

How to repeat:
Search for "#define sint2korr" in config-win.h. This line and all those following it, which are wrapped into a "#ifndef _WIN64" compiler conditional define are causing the trouble (lines 258-319).

Suggested fix:
Just remove the declarations from config-win.h. This header file is included by my_global.h and hence does not need the declarations on its own. If this file could be used on its own (for what ever reason) then you could also check in my_global.h if those macros have been declared already and don't do it again if so. A third alternative would be to define those constants in my_global.h only if the current platform is not WIN32, but that would still leave all macros defined in two different places, which makes maintenance a nightmare.
[1 Nov 2006 21:12] Sveta Smirnova
Thank you for the report.

Verified as described using current 5.1 BK sources.
[1 Nov 2006 21:15] Sveta Smirnova
All versions are affected
[27 Feb 2008 21:30] 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/43114

ChangeSet@1.2588, 2008-02-27 16:17:05-05:00, iggy@alf.(none) +3 -0
  Bug #23839 Multiple declarations of macros
  - Remove duplicate macro defintions.
[27 Mar 2008 22:03] Bugs System
Pushed into 5.1.24-rc
[27 Mar 2008 22:11] Bugs System
Pushed into 5.0.60
[28 Mar 2008 11:10] Bugs System
Pushed into 6.0.5-alpha
[12 Apr 2008 3:02] Paul DuBois
Noted in 5.0.60, 5.1.24, 6.0.5 changelogs.

The MySQL header files contained some duplicate macro definitions
that could cause compilation problems.