mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +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.
This commit is contained in:
@@ -1325,7 +1325,7 @@ pthread_handler_t handle_bootstrap(void *arg)
|
||||
thd->init_for_queries();
|
||||
while (fgets(buff, thd->net.max_packet, file))
|
||||
{
|
||||
char *query;
|
||||
char *query, *res;
|
||||
ulong length= (ulong) strlen(buff);
|
||||
while (buff[length-1] != '\n' && !feof(file))
|
||||
{
|
||||
@@ -1340,7 +1340,7 @@ pthread_handler_t handle_bootstrap(void *arg)
|
||||
break;
|
||||
}
|
||||
buff= (char*) thd->net.buff;
|
||||
fgets(buff + length, thd->net.max_packet - length, file);
|
||||
res= fgets(buff + length, thd->net.max_packet - length, file);
|
||||
length+= (ulong) strlen(buff + length);
|
||||
}
|
||||
if (thd->is_fatal_error)
|
||||
|
||||
Reference in New Issue
Block a user