List:MySQL++« Previous MessageNext Message »
From:Королев Илья Date:October 17 2006 7:54am
Subject:Re: [bug #7448] Patch to remove some warnings
View as plain text  
В сообщении от 17 октября 2006 11:37 Warren Young написал(a):
> Korolyov Ilya wrote:
> > Original custom.pl.patch has such line:
> >
> >   if (cmp = mysqlpp::sql_cmp(x.C$j , y.C$j ))
> >
> > it give some additional warnings, so I propose to change it for:
> >
> >   if ((cmp = mysqlpp::sql_cmp(x.C$j , y.C$j)))
>
> Two minor objections:
>
> 1. What compiler(s) emit these warnings, and what flags does it take to
> make it happen?
>
> 2. I'd rather move the assignment out of the test part of the if
> statement than just add some opaque parens, but I can take care of that.

1.
Compiler
gcc --version
i586-alt-linux-gcc (GCC) 4.1.1 20060928 (ALT Linux, build 4.1.1-alt9)

Flags
-g -Wall -O0

Give such warnings:
../../../include/table_types/stat_advdaily.h: In function 'int 
sql_compare_DB_AdvDaily(const DB_AdvDaily&, const DB_AdvDaily&) [with 
mysqlpp::sql_dummy_type dummy = sql_dummy]':
../../../include/table_types/stat_advdaily.h:18:   instantiated from here
../../../include/table_types/stat_advdaily.h:18: warning: suggest parentheses 
around assignment used as truth value

2. I don't insist on my variant, it was just the simplest solution :)
Thread
Re: [bug #7448] Patch to remove some warningsWarren Young17 Oct
  • Re: [bug #7448] Patch to remove some warningsКоролев Илья17 Oct
    • Re: [bug #7448] Patch to remove some warningsWarren Young17 Oct