summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorStaale Smedseng <staale.smedseng@sun.com>2009-08-28 17:51:31 +0200
committerStaale Smedseng <staale.smedseng@sun.com>2009-08-28 17:51:31 +0200
commit1ba25ae47caace207cda0be2b7994a1a845e6cce (patch)
tree4278d9f3353d5c86ca327f6ac2680c001e809843 /sql/sql_acl.cc
parent5edd807a7ab72fc16472293fc94a7eb8e762e2b7 (diff)
downloadmariadb-git-1ba25ae47caace207cda0be2b7994a1a845e6cce.tar.gz
Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2 This patch fixes a number of GCC warnings about variables used before initialized. A new macro UNINIT_VAR() is introduced for use in the variable declaration, and LINT_INIT() usage will be gradually deprecated. (A workaround is used for g++, pending a patch for a g++ bug.) GCC warnings for unused results (attribute warn_unused_result) for a number of system calls (present at least in later Ubuntus, where the usual void cast trick doesn't work) are also fixed. client/mysqlmanager-pwgen.c: A fix for warn_unused_result, adding fallback to use of srand()/rand() if /dev/random cannot be used. Also actually adds calls to rand() in the second branch so that it actually creates a random password.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index ab4e518d5dd..ea17a4227ef 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -5067,17 +5067,13 @@ static int handle_grant_struct(uint struct_no, bool drop,
uint elements;
const char *user;
const char *host;
- ACL_USER *acl_user;
- ACL_DB *acl_db;
- GRANT_NAME *grant_name;
+ ACL_USER *UNINIT_VAR(acl_user);
+ ACL_DB *UNINIT_VAR(acl_db);
+ GRANT_NAME *UNINIT_VAR(grant_name);
DBUG_ENTER("handle_grant_struct");
DBUG_PRINT("info",("scan struct: %u search: '%s'@'%s'",
struct_no, user_from->user.str, user_from->host.str));
- LINT_INIT(acl_user);
- LINT_INIT(acl_db);
- LINT_INIT(grant_name);
-
safe_mutex_assert_owner(&acl_cache->lock);
/* Get the number of elements in the in-memory structure. */