mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Fix for valgrind/purify for variables that the compiler touches but that doesn't affect the outcome of the tests
This commit is contained in:
parent
8e8c1a4756
commit
a9c7e3179c
2 changed files with 14 additions and 5 deletions
|
@ -370,6 +370,12 @@ int __void__;
|
|||
#define LINT_INIT(var)
|
||||
#endif
|
||||
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_purify)
|
||||
#define PURIFY_OR_LINT_INIT(var) var=0
|
||||
#else
|
||||
#define PURIFY_OR_LINT_INIT(var)
|
||||
#endif
|
||||
|
||||
/* Define some useful general macros */
|
||||
#if defined(__cplusplus) && defined(__GNUC__)
|
||||
#define max(a, b) ((a) >? (b))
|
||||
|
|
|
@ -161,21 +161,24 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
|
|||
{
|
||||
int weekday= 0, yearday= 0, daypart= 0;
|
||||
int week_number= -1;
|
||||
CHARSET_INFO *cs= &my_charset_bin;
|
||||
int error= 0;
|
||||
bool usa_time= 0;
|
||||
bool sunday_first_n_first_week_non_iso= -2;
|
||||
bool strict_week_number;
|
||||
int strict_week_number_year= -1;
|
||||
bool strict_week_number_year_type= -1;
|
||||
int frac_part;
|
||||
bool usa_time= 0;
|
||||
bool sunday_first_n_first_week_non_iso;
|
||||
bool strict_week_number;
|
||||
bool strict_week_number_year_type;
|
||||
const char *val_begin= val;
|
||||
const char *val_end= val + length;
|
||||
const char *ptr= format->format.str;
|
||||
const char *end= ptr + format->format.length;
|
||||
CHARSET_INFO *cs= &my_charset_bin;
|
||||
DBUG_ENTER("extract_date_time");
|
||||
|
||||
LINT_INIT(strict_week_number);
|
||||
/* Remove valgrind varnings when using gcc 3.3 and -O1 */
|
||||
PURIFY_OR_LINT_INIT(strict_week_number_year_type);
|
||||
PURIFY_OR_LINT_INIT(sunday_first_n_first_week_non_iso);
|
||||
|
||||
if (!sub_pattern_end)
|
||||
bzero((char*) l_time, sizeof(*l_time));
|
||||
|
|
Loading…
Reference in a new issue