[vlc-devel] [PATCH] test: hxxx: fix potentially uninitialized variable warnings

Alexandre Janniaux ajanni at videolabs.io
Mon Nov 11 12:25:23 CET 2019


Hi,

On Sat, Nov 09, 2019 at 08:05:25AM +0900, Rémi Denis-Courmont wrote:
> Yeah. This patch does not look right.

Ok, what does not look right? The comment?

On Sat, Nov 09, 2019 at 08:05:25AM +0900, Rémi Denis-Courmont wrote:
> Don't confuse unitialised (a bug) with maybe unitialised (often not a bug).

What makes you think I'm confusing both of these?

This patch removes a warning about usage of uninitialized
variables, which are in fact not used in these case. So yes
I'm not fixing a bug, but still hinting the compiler to
silence it since the behaviour of the test function doesn't
imply it.

Maybe it's not the correct way to fix the warning but I
don't see how you get the confusion thing.

Regards,
--
Alexandre Janniaux
Videolabs

> Le 28 octobre 2019 15:24:06 GMT+09:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
> >On 2019-10-26 14:17, Alexandre Janniaux wrote:
> >> ---
> >>   test/modules/packetizer/hxxx.c | 4 ++++
> >>   1 file changed, 4 insertions(+)
> >>
> >> diff --git a/test/modules/packetizer/hxxx.c
> >b/test/modules/packetizer/hxxx.c
> >> index 6a7767570f..8cae9bfd86 100644
> >> --- a/test/modules/packetizer/hxxx.c
> >> +++ b/test/modules/packetizer/hxxx.c
> >> @@ -62,6 +62,10 @@ static void test_iterators( const uint8_t *p_ab,
> >size_t i_ab, /* AnnexB */
> >>           int i_nal = 0;
> >>           while(b1 && b2)
> >>           {
> >> +            /* hxxx_*_iterate_next can potentially not set these
> >pointers. */
> >
> >Yes, but in this case b1/b2 is false and the value is not used.
> >
> >> +            p_start_ab = NULL;
> >> +            p_start_prefix = NULL;
> >> +
> >>               b1 = hxxx_annexb_iterate_next( &it_ab, &p_start_ab,
> >&i_size_ab );
> >>               b2 = hxxx_iterate_next( &it_prefix, &p_start_prefix,
> >&i_size_prefix );
> >>               printf("NAL %d ", i_nal++);
> >> --
> >> 2.23.0
> >>
> >> _______________________________________________
> >> vlc-devel mailing list
> >> To unsubscribe or modify your subscription options:
> >> https://mailman.videolan.org/listinfo/vlc-devel
> >>
> >_______________________________________________
> >vlc-devel mailing list
> >To unsubscribe or modify your subscription options:
> >https://mailman.videolan.org/listinfo/vlc-devel
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.

> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list