Re: Compilation of libdvbpsi fails on GCC 5.1.0 with --enable-debug
Jean-Paul Saman <[email protected]> Wed, 27 May 2015 09:27:26 +0200
| Newsgroups | gmane.comp.video.videolan.libdvbpsi.devel |
|---|---|
| Message-ID | <CAK9US3AidvZuR2S-8YsUV-g_ir1CWRQizCz3xeEo0LVqw+q+Ow@mail.gmail.com> |
On Tue, May 26, 2015 at 10:35 PM, Daniel Kamil Kozar <[email protected]> wrote: > Hello all, > Compilation of libdvbpsi with GCC 5.1.0 fails due to the following error : > > test_dr.c: In function ‘main_vstream_1’: > test_dr.h:106:39: error: comparison of constant ‘12’ with boolean > expression is always true [-Werror=bool-compare] > } while(!i_err && (s_decoded.name <= 12)); \ > ^ > test_dr.c:49:3: note: in expansion of macro ‘BOZO_end_boolean’ > BOZO_end_boolean(b_multiple_frame_rate) > ^ > > I have to admit that I don't fully understand the intention of the > original code. The macro, when expanded, yields the following result : > > s_decoded.b_multiple_frame_rate += 12; > } while(!i_err && (s_decoded.b_multiple_frame_rate <= 12)); > > Indeed this does not look correct. Question is should b_multiple_frame_rate be a boolean or is it supposed to be an integer? > Where 'b_multiple_frame_rate' is a variable of type bool. Compiling > the code with -Werror disabled causes the code to be compiled into an > infinite loop. > > What is the intention of incrementing a bool value by 12 and then > comparing that bool with an integer value? > It is test code from the early days of libdvbpsi and has had no attention for a long time. I guess what happened is that b_multiple_frame_rate was declared as an integer initially and that at some point that definition was changed into a boolean (because of the prefix). That introduced the mention issue, of course. Increasing the boolean by 12 suggest it is supposed to be an integer iso an boolean. If that is the case then the variable name is misleading. Or the test is wrong and it should have been a boolean all along. Can you look into that? > > Kind regards, > Daniel > _______________________________________________ > libdvbpsi-devel mailing list > [email protected] > https://mailman.videolan.org/listinfo/libdvbpsi-devel > Kind regards, Jean-Paul Saman. _______________________________________________ libdvbpsi-devel mailing list [email protected] https://mailman.videolan.org/listinfo/libdvbpsi-devel