[linux-dvb] little bug in mt2131.c

Steven Toth stoth at hauppauge.com
Tue Oct 23 22:10:33 CEST 2007


Thierry Merle wrote:
> kevin liu a écrit :
>   
>> Dear Stoth:
>>     I found that in mt2131.c, function mt2131_set_params(),
>>     line 119 has a little bug:
>>     ^^^^^^^^^^^^^^^^^^^^^
>>     priv->frequency =  (f_lo1 - f_lo2 - MT2131_IF2) * 1000,
>>     should be
>>     priv->frequency =  (f_lo1 - f_lo2 - MT2131_IF2) * 1000;
>>     ______________________________________
>>     And i wonder why Gcc can not check out the fault?????
>>
>> --
>> video4linux-list mailing list
>> Unsubscribe mailto:video4linux-list-request at redhat.com?subject=unsubscribe
>> https://www.redhat.com/mailman/listinfo/video4linux-list
>>
>>   
>>     
> In ANSI C, this is correct although rarely used like that.
> I suppose it is followed by a line that ends with a semicolon.
> Look at the K&R syntax in BNF here:
> http://www.cs.man.ac.uk/~pjj/bnf/c_syntax.k_r
>
> stat			: id ':' stat
> 			| 'case' const_exp ':' stat
> 			| 'default' ':' stat
> 			| exp? ';'
> 			| compound_stat
> 			| 'if' '(' exp ')' stat
> 			| 'if' '(' exp ')' stat 'else' stat
> 			| 'switch' '(' exp ')' stat
> 			| 'while' '(' exp ')' stat
> 			| 'do' stat 'while' '(' exp ')' ';'
> 			| 'for' '(' exp? ';' exp? ';' exp? ')' stat
> 			| 'goto' id ';'
> 			| 'continue' ';'
> 			| 'break' ';'
> 			| 'return' exp? ';'
>
>
> exp			: assignement_exp ( ',' assignment_exp )*
>
> So a statement (stat) must end with ';', it can be an expression (exp)
> that is a list of assignement_exp separated by ','.
>
> No bug in the generated code but subject to discussions, so wrong :)
>
>   
Weird, yeah, I don't like that. I'll put up a patch soon.

Thanks,

- Steve





More information about the linux-dvb mailing list