1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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.
This commit is contained in:
Staale Smedseng
2009-08-28 17:51:31 +02:00
parent 5edd807a7a
commit 1ba25ae47c
51 changed files with 142 additions and 191 deletions

View File

@ -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. */