diff options
author | Michael Widenius <monty@askmonty.org> | 2009-11-30 01:08:56 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2009-11-30 01:08:56 +0200 |
commit | d13c54351dd7ec5c538ff746704c6a8096b25776 (patch) | |
tree | 29515d03576ab3021ec5a7e5e353d68f782ffd91 /cmd-line-utils | |
parent | d210df50a21d82a1f20c6bc786149478801e91c6 (diff) | |
download | mariadb-git-d13c54351dd7ec5c538ff746704c6a8096b25776.tar.gz |
Remove compiler warnings (Including some warnings from -Wstrict-aliasing)
Don't use static link by default (in compile-pentium) as some new systems doesn't have all static libraries available
Change type for functions in plugin.h:str_mysql_ftparser_param() to const unsigned char and string lengths to size_t.
One effect of the above change is that one needs to include mysql_global.h or define size_t before including plugin.h
This fixes a case where mysql_client_test failed with newer gcc that enables strict-aliasing by default
BUILD/compile-pentium:
Don't use static link by default as some new systems doesn't have all static libraries available
client/mysql_upgrade.c:
Remove not used variable
cmd-line-utils/readline/config_readline.h:
Define some constants to get rid of compiler warnings on Linux
cmd-line-utils/readline/display.c:
Get rid of compiler warnings
cmd-line-utils/readline/history.c:
Got rid of compiler warnings:
- Defining some strings as const
- Added cast
cmd-line-utils/readline/rlmbutil.h:
Added cast to get rid of compiler warnings
cmd-line-utils/readline/text.c:
Remove not needed initialization to get rid of compiler warnings
cmd-line-utils/readline/xmalloc.c:
Changed types to 'const char* to get rid of compiler warnings
configure.in:
Ensure that we use MariaDB as suffix
include/mysql/plugin.h:
Changed types to 'const unsigned char* to get rid of compiler warnings (in other parts of the code)
Change length for not \0 terminated string to size_t
include/mysql/plugin.h.pp:
Update related to plugin.h
libmysql/libmysql.c:
Fixed bug that caused core dump with newer gcc when strict aliasing is not turned off
mysql-test/t/information_schema.test:
Test is depending on innodb
mysql-test/t/not_partition.test:
Fixed wrong directory name
(Not noticed before as we don't ususally run this test)
mysys/lf_hash.c:
Got rid of compiler warnings from -Wstrict-aliasing
mysys/my_redel.c:
Removed not used variable
regex/engine.c:
Changed types to 'const char* to get rid of compiler warnings
regex/engine.ih:
Changed types to 'const char* to get rid of compiler warnings
sql/sp_head.cc:
Got rid of compiler warning from -Wstrict-aliasing
sql/sql_base.cc:
Got rid of compiler warnings from -Wstrict-aliasing
(The original code was probably wrong as nj_col->table_field was
sql/sql_builtin.cc.in:
plugin.h needs to have size_t defined
sql/sql_parse.cc:
Remove used variable
sql/sql_select.cc:
Got rid of compiler warnings from -Wstrict-aliasing
sql/sql_show.cc:
Added #ifdef to get rid of compiler warning when not using partition engine
sql/table.cc:
Got rid of compiler warning from -Wstrict-aliasing
storage/maria/ha_maria.cc:
Got rid of compiler warnings from -Wstrict-aliasing:
- Use the thd_killed() API function
storage/maria/lockman.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/ma_check.c:
Got rid of compiler warnings from -Wstrict-aliasing
Change to use new version of _ma_killed_ptr; Don't call it as often as before
storage/maria/ma_check_standalone.h:
Update to compatible _ma_killed_ptr() from ha_maria.cc
storage/maria/ma_ft_boolean_search.c:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_ft_nlq_search.c:
Got rid of compiler warnings from -Wstrict-aliasing
Ensure that 'subkeys' is 32 bit
storage/maria/ma_ft_parser.c:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_ftdefs.h:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_sort.c:
Change to use new version of _ma_killed_ptr; Don't call it as often as before
storage/maria/ma_state.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/maria_def.h:
Redefine ma_killed_ptr()
storage/maria/maria_ftdump.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/trnman.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/ft_boolean_search.c:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ft_nlq_search.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/ft_parser.c:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ft_stopwords.c:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ftdefs.h:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ha_myisam.cc:
Got rid of compiler warnings from -Wstrict-aliasing:
- Use the thd_killed() API function
storage/myisam/mi_check.c:
Use new killed_ptr() function
storage/myisam/myisam_ftdump.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/myisamchk.c:
Update to compatible killed_ptr() from ha_myisam.cc
storage/myisam/myisamdef.h:
Redefine killed_ptr()
storage/myisam/myisamlog.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/sort.c:
Change to use new version of killed_ptr; Don't call it as often as before
storage/xtradb/fil/fil0fil.c:
Fixedc ompiler warning
storage/xtradb/trx/trx0i_s.c:
Include mysql_plugin.h later to ensure that size_t is defined
Diffstat (limited to 'cmd-line-utils')
-rw-r--r-- | cmd-line-utils/readline/config_readline.h | 5 | ||||
-rw-r--r-- | cmd-line-utils/readline/display.c | 8 | ||||
-rw-r--r-- | cmd-line-utils/readline/history.c | 4 | ||||
-rw-r--r-- | cmd-line-utils/readline/rlmbutil.h | 4 | ||||
-rw-r--r-- | cmd-line-utils/readline/text.c | 2 | ||||
-rw-r--r-- | cmd-line-utils/readline/xmalloc.c | 2 |
6 files changed, 15 insertions, 10 deletions
diff --git a/cmd-line-utils/readline/config_readline.h b/cmd-line-utils/readline/config_readline.h index 141989ec3c9..69bf18efc1f 100644 --- a/cmd-line-utils/readline/config_readline.h +++ b/cmd-line-utils/readline/config_readline.h @@ -7,6 +7,11 @@ # include <config.h> #endif +/* to get wcwidth() defined */ +#define _XOPEN_SOURCE 600 +#define _XOPEN_SOURCE_EXTENDED +#define _XOPEN_ + /* Ultrix botches type-ahead when switching from canonical to non-canonical mode, at least through version 4.3 diff --git a/cmd-line-utils/readline/display.c b/cmd-line-utils/readline/display.c index 720ef3a82e4..fa710fc28b1 100644 --- a/cmd-line-utils/readline/display.c +++ b/cmd-line-utils/readline/display.c @@ -461,12 +461,12 @@ rl_redisplay () register char *line; int inv_botlin, lb_linenum, o_cpos; int newlines, lpos, temp, modmark; - char *prompt_this_line; + const char *prompt_this_line; #if defined (HANDLE_MULTIBYTE) - int num, n0; + int num, n0= 0; wchar_t wc; size_t wc_bytes; - int wc_width; + int wc_width= 0; mbstate_t ps; int _rl_wrapped_multicolumn = 0; #endif @@ -824,7 +824,7 @@ rl_redisplay () cpos_buffer_position = out; lb_linenum = newlines; } - for (i = in; i < in+wc_bytes; i++) + for (i = in; (size_t) i < in+wc_bytes; i++) line[out++] = rl_line_buffer[i]; for (i = 0; i < wc_width; i++) CHECK_LPOS(); diff --git a/cmd-line-utils/readline/history.c b/cmd-line-utils/readline/history.c index c81101fc555..c6c46482f50 100644 --- a/cmd-line-utils/readline/history.c +++ b/cmd-line-utils/readline/history.c @@ -211,14 +211,14 @@ history_get (offset) HIST_ENTRY * alloc_history_entry (string, ts) - char *string; + const char *string; char *ts; { HIST_ENTRY *temp; temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); - temp->line = string ? savestring (string) : string; + temp->line = string ? savestring ((char*) string) : (char*) string; temp->data = (char *)NULL; temp->timestamp = ts; diff --git a/cmd-line-utils/readline/rlmbutil.h b/cmd-line-utils/readline/rlmbutil.h index dd317e2a090..1ed402e0dba 100644 --- a/cmd-line-utils/readline/rlmbutil.h +++ b/cmd-line-utils/readline/rlmbutil.h @@ -109,8 +109,8 @@ extern int _rl_is_mbchar_matched PARAMS((char *, int, int, char *, int)); extern wchar_t _rl_char_value PARAMS((char *, int)); extern int _rl_walphabetic PARAMS((wchar_t)); -#define _rl_to_wupper(wc) (iswlower (wc) ? towupper (wc) : (wc)) -#define _rl_to_wlower(wc) (iswupper (wc) ? towlower (wc) : (wc)) +#define _rl_to_wupper(wc) (iswlower (wc) ? (wchar_t) towupper (wc) : (wc)) +#define _rl_to_wlower(wc) (iswupper (wc) ? (wchar_t) towlower (wc) : (wc)) #define MB_NEXTCHAR(b,s,c,f) \ ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \ diff --git a/cmd-line-utils/readline/text.c b/cmd-line-utils/readline/text.c index 9c21e784e1f..774ba1eb2c0 100644 --- a/cmd-line-utils/readline/text.c +++ b/cmd-line-utils/readline/text.c @@ -614,7 +614,7 @@ rl_arrow_keys (count, c) #ifdef HANDLE_MULTIBYTE static char pending_bytes[MB_LEN_MAX]; static int pending_bytes_length = 0; -static mbstate_t ps = {0}; +static mbstate_t ps; #endif /* Insert the character C at the current location, moving point forward. diff --git a/cmd-line-utils/readline/xmalloc.c b/cmd-line-utils/readline/xmalloc.c index cf52da351a8..1a086852552 100644 --- a/cmd-line-utils/readline/xmalloc.c +++ b/cmd-line-utils/readline/xmalloc.c @@ -42,7 +42,7 @@ static void memory_error_and_abort (fname) - char *fname; + const char *fname; { fprintf (stderr, "%s: out of virtual memory\n", fname); exit (2); |