From 5d6ad2ad66a677b67f2377d7665d6c140dd93323 Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 5 Feb 2021 14:57:46 +0200 Subject: Added 'const' to arguments in get_one_option and find_typeset() One should not change the program arguments! This change also reduces warnings from the icc compiler. Almost all changes are just syntax changes (adding const to 'get_one_option function' declarations). Other changes: - Added a few cast of 'argument' from 'const char*' to 'char *'. This was mainly in calls to 'external' functions we don't have control of. - Ensure that all reset of 'password command line argument' are similar. (In almost all cases it was just adding a comment and a cast) - In mysqlbinlog.cc and mysqld.cc there was a few cases that changed the command line argument. These places where changed to instead allocate the option in a MEM_ROOT to avoid changing the argument. Some of this code was changed to ensure that different programs did parsing the same way. Added a test case for the changes in mysqlbinlog.cc - Changed a few variables that took their value from command line options from 'char *' to 'const char *'. --- client/mysql_plugin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client/mysql_plugin.c') diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index eddae6114e6..79b97eaea02 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -475,7 +475,8 @@ static void print_default_values(void) static my_bool get_one_option(const struct my_option *opt, - char *argument, const char *filename __attribute__((unused))) + const char *argument, + const char *filename __attribute__((unused))) { switch(opt->id) { case 'n': -- cgit v1.2.1