From a092ed1afe3c3c7889810f45d591cfb2633c87f9 Mon Sep 17 00:00:00 2001 From: Staale Smedseng Date: Tue, 9 Jun 2009 14:55:30 +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 first patch, fixing a number of the warnings, predominantly "suggest using parentheses around && in ||", and empty for and while bodies. --- sql/item_timefunc.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sql/item_timefunc.cc') diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 22ca8a925db..39f869106b6 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -439,7 +439,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, strict_week_number= (*ptr=='V' || *ptr=='v'); tmp= (char*) val + min(val_len, 2); if ((week_number= (int) my_strtoll10(val, &tmp, &error)) < 0 || - strict_week_number && !week_number || + (strict_week_number && !week_number) || week_number > 53) goto err; val= tmp; @@ -535,10 +535,10 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, %V,%v require %X,%x resprectively, %U,%u should be used with %Y and not %X or %x */ - if (strict_week_number && + if ((strict_week_number && (strict_week_number_year < 0 || - strict_week_number_year_type != sunday_first_n_first_week_non_iso) || - !strict_week_number && strict_week_number_year >= 0) + strict_week_number_year_type != sunday_first_n_first_week_non_iso)) || + (!strict_week_number && strict_week_number_year >= 0)) goto err; /* Number of days since year 0 till 1st Jan of this year */ -- cgit v1.2.1 From a073ee45c290d81d365b48b03ef6924e778cd64f Mon Sep 17 00:00:00 2001 From: Staale Smedseng Date: Tue, 9 Jun 2009 18:11:21 +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 first patch, fixing a number of the warnings, predominantly "suggest using parentheses around && in ||", and empty for and while bodies. --- sql/item_timefunc.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sql/item_timefunc.cc') diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 22ca8a925db..39f869106b6 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -439,7 +439,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, strict_week_number= (*ptr=='V' || *ptr=='v'); tmp= (char*) val + min(val_len, 2); if ((week_number= (int) my_strtoll10(val, &tmp, &error)) < 0 || - strict_week_number && !week_number || + (strict_week_number && !week_number) || week_number > 53) goto err; val= tmp; @@ -535,10 +535,10 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, %V,%v require %X,%x resprectively, %U,%u should be used with %Y and not %X or %x */ - if (strict_week_number && + if ((strict_week_number && (strict_week_number_year < 0 || - strict_week_number_year_type != sunday_first_n_first_week_non_iso) || - !strict_week_number && strict_week_number_year >= 0) + strict_week_number_year_type != sunday_first_n_first_week_non_iso)) || + (!strict_week_number && strict_week_number_year >= 0)) goto err; /* Number of days since year 0 till 1st Jan of this year */ -- cgit v1.2.1