Bug #55527 initializing: different const qualifiers
Submitted: 23 Jul 2010 23:50 Modified: 16 Jan 2014 12:28
Reporter: Vladislav Vaintroub Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.1 OS:Windows
Assigned to: CPU Architecture:Any

[23 Jul 2010 23:50] Vladislav Vaintroub
Description:
After to recent GCC warnings cleanup, there is a lot of new warnings with Visual Studio. An example for it is "initializing: different const qualifiers" , which was not seen before and now present ~ 50 times (in branches with 0 GCC warnings).

How to repeat:
Compile said branch with Visual Studio
[15 Oct 2010 9:41] Magnus Blåudd
One possible solution.

=== modified file 'include/my_getopt.h'
--- a/include/my_getopt.h	2010-10-06 10:06:47 +0000
+++ b/include/my_getopt.h	2010-10-14 17:00:38 +0000
@@ -48,8 +48,14 @@ struct my_option
   const char *name;                     /* Name of the option */
   int        id;                        /* unique id or short option */
   const char *comment;                  /* option comment, for autom. --help */
-  void       *value;                    /* The variable value */
-  void       *u_max_value;              /* The user def. max variable value */
+  union {
+    void       *value;                    /* The variable value */
+    const char *cstr_value;
+  };
+  union {
+    void       *u_max_value;              /* The user def. max variable value */
+    const char *cstr_u_max_value;
+  };
   struct st_typelib *typelib;           /* Pointer to possible values */
   ulong      var_type;                  /* Must match the variable type */
   enum get_opt_arg_type arg_type;
[16 Jan 2014 12:28] Ståle Deraas
Duplicate of bug#43915