<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 26, 2015 at 10:35 PM, Daniel Kamil Kozar <span dir="ltr"><<a href="mailto:dkk089@gmail.com" target="_blank">dkk089@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello all,<br>
Compilation of libdvbpsi with GCC 5.1.0 fails due to the following error :<br>
<br>
test_dr.c: In function ‘main_vstream_1’:<br>
test_dr.h:106:39: error: comparison of constant ‘12’ with boolean<br>
expression is always true [-Werror=bool-compare]<br>
     } while(!i_err && (<a href="http://s_decoded.name" target="_blank">s_decoded.name</a> <= 12));                          \<br>
                                       ^<br>
test_dr.c:49:3: note: in expansion of macro ‘BOZO_end_boolean’<br>
   BOZO_end_boolean(b_multiple_frame_rate)<br>
   ^<br>
<br>
I have to admit that I don't fully understand the intention of the<br>
original code. The macro, when expanded, yields the following result :<br>
<br>
  s_decoded.b_multiple_frame_rate += 12;<br>
} while(!i_err && (s_decoded.b_multiple_frame_rate <= 12));<br>
<br></blockquote><div><br>Indeed this does not look correct. Question is should b_multiple_frame_rate<br>be a boolean or is it supposed to be an integer?<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Where 'b_multiple_frame_rate' is a variable of type bool. Compiling<br>
the code with -Werror disabled causes the code to be compiled into an<br>
infinite loop.<br>
<br>
What is the intention of incrementing a bool value by 12 and then<br>
comparing that bool with an integer value?<br></blockquote><div><br></div><div>It is test code from the early days of libdvbpsi and has had no attention for a long time.<br></div><div>I guess what happened is that b_multiple_frame_rate was declared as an integer initially<br></div><div>and that at some point that definition was changed into a boolean (because of the prefix).<br></div><div>That introduced the mention issue, of course.<br></div><div><br></div><div>Increasing the boolean by 12 suggest it is supposed to be an integer iso an boolean. If that<br></div><div>is the case then the variable name is misleading. Or the test is wrong and it should have been<br></div><div>a boolean all along.<br><br></div><div>Can you look into that?<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Kind regards,<br>
Daniel<br>
_______________________________________________<br>
libdvbpsi-devel mailing list<br>
<a href="mailto:libdvbpsi-devel@videolan.org">libdvbpsi-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/libdvbpsi-devel" target="_blank">https://mailman.videolan.org/listinfo/libdvbpsi-devel</a><br>
</blockquote></div><br></div><div class="gmail_extra">Kind regards,<br></div><div class="gmail_extra">Jean-Paul Saman.<br></div></div>