ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Build issues with packet-quic.c

From: Richard Sharpe <realrichardsharpe@xxxxxxxxx>
Date: Sat, 23 Dec 2017 13:53:02 -0800
On Sat, Dec 23, 2017 at 1:44 PM, Richard Sharpe
<realrichardsharpe@xxxxxxxxx> wrote:
> On Sat, Dec 23, 2017 at 1:25 PM, Dario Lombardo
> <dario.lombardo.ml@xxxxxxxxx> wrote:
>> Hi Richard, and Merry Christmas to you!
>> Which version are you using? Git blame shows me old commits on that file (15
>> nov and older), but the code looks good to me and no warnings are raised by
>> my compilers.
>
> Hmmm, strange.
>
> I am using the latest master ... maybe my default compiler flags are
> more strict ...
>
> I am building on something that is like RHEL 7.2 with gcc 4.8.5 but it
> just started happening ...
>
> and it seems to occur when I pull in Alexis' recent changes.

My version of gcc might be too old.

num_ts set here, inside an if block:

        /* No longer Timestamps Block with draft07 */
        if(quic_info->version == 0xFF000005 || quic_info->version ==
0xFF000006) {
            proto_tree_add_item(ft_tree,
hf_quic_frame_type_ack_num_ts, tvb, offset, 1, ENC_NA);
            num_ts = tvb_get_guint8(tvb , offset);
            offset += 1;
        }

so later at line 530 the the compiler can't seem to detect that num_ts
is definitely initialized.

I suspect that it is better to initialize it to 0 to quieten the compiler.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)