From 9e7c9d100f85fac9a05c0bdeb3a5bb97be322863 Mon Sep 17 00:00:00 2001 From: Staale Smedseng Date: Wed, 10 Jun 2009 16:04:07 +0200 Subject: Bug #43414 Parenthesis (and other) warnings compiling MySQL with gcc 4.3.2 Compiling MySQL with gcc 4.3.2 and later produces a number of warnings, many of which are new with the recent compiler versions. This bug will be resolved in more than one patch to limit the size of changesets. This is the second patch, fixing more of the warnings. --- sql/sql_lex.cc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'sql/sql_lex.cc') diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 436f41dd209..2542207e9b3 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -594,7 +594,7 @@ int MYSQLlex(void *arg, void *yythd) its value in a query for the binlog, the query must stay grammatically correct. */ - else if (c == '?' && lip->stmt_prepare_mode && !ident_map[yyPeek()]) + else if (c == '?' && lip->stmt_prepare_mode && !ident_map[(int)yyPeek()]) return(PARAM_MARKER); return((int) c); @@ -661,7 +661,7 @@ int MYSQLlex(void *arg, void *yythd) else #endif { - for (result_state= c; ident_map[c= yyGet()]; result_state|= c); + for (result_state= c; ident_map[c= yyGet()]; result_state|= c) ; /* If there were non-ASCII characters, mark that we must convert */ result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT; } @@ -673,9 +673,9 @@ int MYSQLlex(void *arg, void *yythd) If we find a space then this can't be an identifier. We notice this below by checking start != lex->ptr. */ - for (; state_map[c] == MY_LEX_SKIP ; c= yyGet()); + for (; state_map[c] == MY_LEX_SKIP ; c= yyGet()) ; } - if (start == lip->ptr && c == '.' && ident_map[yyPeek()]) + if (start == lip->ptr && c == '.' && ident_map[(int)yyPeek()]) lip->next_state=MY_LEX_IDENT_SEP; else { // '(' must follow directly if function @@ -708,7 +708,7 @@ int MYSQLlex(void *arg, void *yythd) yylval->lex_str.length=1; c=yyGet(); // should be '.' lip->next_state= MY_LEX_IDENT_START;// Next is an ident (not a keyword) - if (!ident_map[yyPeek()]) // Probably ` or " + if (!ident_map[(int)yyPeek()]) // Probably ` or " lip->next_state= MY_LEX_START; return((int) c); @@ -782,11 +782,11 @@ int MYSQLlex(void *arg, void *yythd) else #endif { - for (result_state=0; ident_map[c= yyGet()]; result_state|= c); + for (result_state=0; ident_map[c= yyGet()]; result_state|= c) ; /* If there were non-ASCII characters, mark that we must convert */ result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT; } - if (c == '.' && ident_map[yyPeek()]) + if (c == '.' && ident_map[(int)yyPeek()]) lip->next_state=MY_LEX_IDENT_SEP;// Next is '.' yylval->lex_str= get_token(lip, 0, yyLength()); @@ -872,7 +872,7 @@ int MYSQLlex(void *arg, void *yythd) case MY_LEX_BIN_NUMBER: // Found b'bin-string' yyGet(); // Skip ' - while ((c= yyGet()) == '0' || c == '1'); + while ((c= yyGet()) == '0' || c == '1') ; length= (uint) (lip->ptr - lip->tok_start); // Length of bin-num + 3 if (c != '\'') return(ABORT_SYM); // Illegal hex constant @@ -883,8 +883,8 @@ int MYSQLlex(void *arg, void *yythd) return (BIN_NUM); case MY_LEX_CMP_OP: // Incomplete comparison operator - if (state_map[yyPeek()] == MY_LEX_CMP_OP || - state_map[yyPeek()] == MY_LEX_LONG_CMP_OP) + if (state_map[(int)yyPeek()] == MY_LEX_CMP_OP || + state_map[(int)yyPeek()] == MY_LEX_LONG_CMP_OP) yySkip(); if ((tokval = find_keyword(lip,(uint) (lip->ptr - lip->tok_start),0))) { @@ -895,11 +895,11 @@ int MYSQLlex(void *arg, void *yythd) break; case MY_LEX_LONG_CMP_OP: // Incomplete comparison operator - if (state_map[yyPeek()] == MY_LEX_CMP_OP || - state_map[yyPeek()] == MY_LEX_LONG_CMP_OP) + if (state_map[(int)yyPeek()] == MY_LEX_CMP_OP || + state_map[(int)yyPeek()] == MY_LEX_LONG_CMP_OP) { yySkip(); - if (state_map[yyPeek()] == MY_LEX_CMP_OP) + if (state_map[(int)yyPeek()] == MY_LEX_CMP_OP) yySkip(); } if ((tokval = find_keyword(lip,(uint) (lip->ptr - lip->tok_start),0))) @@ -1043,7 +1043,7 @@ int MYSQLlex(void *arg, void *yythd) } break; case MY_LEX_USER_END: // end '@' of user@hostname - switch (state_map[yyPeek()]) { + switch (state_map[(int)yyPeek()]) { case MY_LEX_STRING: case MY_LEX_USER_VARIABLE_DELIMITER: case MY_LEX_STRING_OR_DELIMITER: @@ -1068,7 +1068,7 @@ int MYSQLlex(void *arg, void *yythd) yylval->lex_str.str=(char*) lip->ptr; yylval->lex_str.length=1; yySkip(); // Skip '@' - lip->next_state= (state_map[yyPeek()] == + lip->next_state= (state_map[(int)yyPeek()] == MY_LEX_USER_VARIABLE_DELIMITER ? MY_LEX_OPERATOR_OR_IDENT : MY_LEX_IDENT_OR_KEYWORD); @@ -1080,7 +1080,7 @@ int MYSQLlex(void *arg, void *yythd) [(global | local | session) .]variable_name */ - for (result_state= 0; ident_map[c= yyGet()]; result_state|= c); + for (result_state= 0; ident_map[c= yyGet()]; result_state|= c) ; /* If there were non-ASCII characters, mark that we must convert */ result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT; @@ -1670,7 +1670,7 @@ void st_select_lex::print_limit(THD *thd, String *str) item->substype() == Item_subselect::ALL_SUBS)) { DBUG_ASSERT(!item->fixed || - select_limit->val_int() == LL(1) && offset_limit == 0); + (select_limit->val_int() == LL(1) && offset_limit == 0)); return; } -- cgit v1.2.1 From 2be7b06b9b26efa6fccec143c627d4b49b2a02b0 Mon Sep 17 00:00:00 2001 From: Staale Smedseng Date: Wed, 17 Jun 2009 15:54:01 +0200 Subject: Bug #43414 Parenthesis (and other) warnings compiling MySQL with gcc 4.3.2 Compiling MySQL with gcc 4.3.2 and later produces a number of warnings, many of which are new with the recent compiler versions. This bug will be resolved in more than one patch to limit the size of changesets. This is the second patch, fixing more of the warnings. --- sql/sql_lex.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sql/sql_lex.cc') diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 436f41dd209..061a20679e7 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -661,7 +661,7 @@ int MYSQLlex(void *arg, void *yythd) else #endif { - for (result_state= c; ident_map[c= yyGet()]; result_state|= c); + for (result_state= c; ident_map[c= yyGet()]; result_state|= c) ; /* If there were non-ASCII characters, mark that we must convert */ result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT; } @@ -673,7 +673,7 @@ int MYSQLlex(void *arg, void *yythd) If we find a space then this can't be an identifier. We notice this below by checking start != lex->ptr. */ - for (; state_map[c] == MY_LEX_SKIP ; c= yyGet()); + for (; state_map[c] == MY_LEX_SKIP ; c= yyGet()) ; } if (start == lip->ptr && c == '.' && ident_map[yyPeek()]) lip->next_state=MY_LEX_IDENT_SEP; @@ -782,7 +782,7 @@ int MYSQLlex(void *arg, void *yythd) else #endif { - for (result_state=0; ident_map[c= yyGet()]; result_state|= c); + for (result_state=0; ident_map[c= yyGet()]; result_state|= c) ; /* If there were non-ASCII characters, mark that we must convert */ result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT; } @@ -872,7 +872,7 @@ int MYSQLlex(void *arg, void *yythd) case MY_LEX_BIN_NUMBER: // Found b'bin-string' yyGet(); // Skip ' - while ((c= yyGet()) == '0' || c == '1'); + while ((c= yyGet()) == '0' || c == '1') ; length= (uint) (lip->ptr - lip->tok_start); // Length of bin-num + 3 if (c != '\'') return(ABORT_SYM); // Illegal hex constant @@ -1080,7 +1080,7 @@ int MYSQLlex(void *arg, void *yythd) [(global | local | session) .]variable_name */ - for (result_state= 0; ident_map[c= yyGet()]; result_state|= c); + for (result_state= 0; ident_map[c= yyGet()]; result_state|= c) ; /* If there were non-ASCII characters, mark that we must convert */ result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT; @@ -1670,7 +1670,7 @@ void st_select_lex::print_limit(THD *thd, String *str) item->substype() == Item_subselect::ALL_SUBS)) { DBUG_ASSERT(!item->fixed || - select_limit->val_int() == LL(1) && offset_limit == 0); + (select_limit->val_int() == LL(1) && offset_limit == 0)); return; } -- cgit v1.2.1