summaryrefslogtreecommitdiff
path: root/mysys/my_getopt.c
diff options
context:
space:
mode:
authorunknown <istruewing@chilla.local>2007-04-30 18:49:38 +0200
committerunknown <istruewing@chilla.local>2007-04-30 18:49:38 +0200
commit0f824dc212f9de5c8bc7590bb89b93d48955bc64 (patch)
tree7bf9e4313e01d0144b146d2529bbcd3ad6fc7607 /mysys/my_getopt.c
parent84c0830bef22b9626feab53897ea493f1cc36f92 (diff)
downloadmariadb-git-0f824dc212f9de5c8bc7590bb89b93d48955bc64.tar.gz
WL#2936 - Falcon & MySQL plugin interface: server variables
Avoid compiler warnings cmd-line-utils/readline/rltty.c: Avoid a compiler warning config/ac-macros/misc.m4: Avoid a compiler warning, which could abort ./configure if CFLAGS contain -Werror.
Diffstat (limited to 'mysys/my_getopt.c')
-rw-r--r--mysys/my_getopt.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 3c67c724a9a..a23e84ab96a 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -842,19 +842,23 @@ static void init_one_value(const struct my_option *option, gptr *variable,
/*
Do not clear variable value if it has no default value.
The default value may already be set.
+ NOTE: To avoid compiler warnings, we first cast longlong to intptr,
+ so that the value has the same size as a pointer.
*/
- if ((char*) value)
- *((char**) variable)= (char*) value;
+ if ((char*) (intptr) value)
+ *((char**) variable)= (char*) (intptr) value;
break;
case GET_STR_ALLOC:
/*
Do not clear variable value if it has no default value.
The default value may already be set.
+ NOTE: To avoid compiler warnings, we first cast longlong to intptr,
+ so that the value has the same size as a pointer.
*/
- if ((char*) value)
+ if ((char*) (intptr) value)
{
my_free((*(char**) variable), MYF(MY_ALLOW_ZERO_PTR));
- *((char**) variable)= my_strdup((char*) value, MYF(MY_WME));
+ *((char**) variable)= my_strdup((char*) (intptr) value, MYF(MY_WME));
}
break;
default: /* dummy default to avoid compiler warnings */