Skip to content

Commit 9964962

Browse files
committed
Added some dummy initializations to keep gcc 4.1.2-44 silent about
use of possibly uninitialized variabes. The logic ensured that these were not actually referenced except under conditions where they had also been initialized, but gcc could not determine that (or likely didn't even try) Without these, build breaks with -Werror using gcc 4.1.2-44 but works with 4.1.2-42
1 parent 90911c9 commit 9964962

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

sql/debug_sync.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,7 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
17371737
if (action->wait_for.length())
17381738
{
17391739
mysql_mutex_t *old_mutex;
1740-
mysql_cond_t *old_cond;
1740+
mysql_cond_t *old_cond= 0;
17411741
int error= 0;
17421742
struct timespec abstime;
17431743

sql/sql_select.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3620,6 +3620,9 @@ class Plan_change_watchdog
36203620
*/
36213621
Plan_change_watchdog(const JOIN_TAB *tab_arg, bool no_changes_arg)
36223622
{
3623+
// Only to keep gcc 4.1.2-44 silent about uninitialized variables
3624+
quick= NULL;
3625+
quick_index= 0;
36233626
if (no_changes_arg)
36243627
{
36253628
tab= tab_arg;
@@ -3633,7 +3636,14 @@ class Plan_change_watchdog
36333636
index= tab->index;
36343637
}
36353638
else
3639+
{
36363640
tab= NULL;
3641+
// Only to keep gcc 4.1.2-44 silent about uninitialized variables
3642+
type= JT_UNKNOWN;
3643+
select= NULL;
3644+
ref_key= ref_key_parts= index= 0;
3645+
use_quick= QS_NONE;
3646+
}
36373647
}
36383648
~Plan_change_watchdog()
36393649
{

0 commit comments

Comments
 (0)