Wireshark-commits: [Wireshark-commits] master 3885912: proto: fix invalid types in hf check routine

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 02 Apr 2020 07:47:31 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=3885912cca308986a319391efe7724a50c9e424c
Submitter: "Anders Broman <a.broman58@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

3885912 by Dario Lombardo (lomato@xxxxxxxxx):

    proto: fix invalid types in hf check routine.
    
    The conditional code compiles with ENABLE_CHECKHF_CONFLICT=1.
    The mix of string_value and string_value64 requires to split
    up the code, and a macro seems to be the most suitable solution
    since types are involved.
    
    The error raises on Ubuntu 18.04:
    
    FAILED: epan/CMakeFiles/epan.dir/proto.c.o
    /usr/bin/cc -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DWS_BUILD_DLL -Depan_EXPORTS -I. -I../ -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/lua5.2 -I/usr/include/libxml2 -Iepan -I../epan -fvisibility=hidden  -fexcess-precision=fast -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wframe-larger-than=32768 -Wc++-compat -Wunused-const-variable -Wshadow -Wold-style-definition -Wstrict-prototypes -Wlogical-op -Wjump-misses-init -Werror=implicit -Wno-pointer-sign -std=gnu99  -O2 -g -DNDEBUG -fPIC   -isystem /usr/include/mit-krb5 -Werror -MD -MT epan/CMakeFiles/epan.dir/proto.c.o -MF epan/CMakeFiles/epan.dir/proto.c.o.d -o epan/CMakeFiles/epan.dir/proto.c.o   -c ../epan/proto.c
    ../epan/proto.c: In function ‘tmp_fld_check_assert’:
    ../epan/proto.c:8013:18: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
         start_values = VAL64_STRING_EXT_VS_P(((const val64_string_ext*)hfinfo->strings));
                      ^
    cc1: all warnings being treated as errors
    [27/388] Building CXX object ui/qt/CMakeFiles/qtui.dir/coloring_rules_dialog.cpp.o
    ninja: build stopped: subcommand failed.
    
    Change-Id: I77c424bac96a1bbe81c0826faef66df7cc476ec4
    Reviewed-on: https://code.wireshark.org/review/36604
    Reviewed-by: Martin Mathieson <martin.r.mathieson@xxxxxxxxxxxxxx>
    Petri-Dish: Martin Mathieson <martin.r.mathieson@xxxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  e07f75f   ieee80211: Beacon Radio Measurement request/report update
     add  3885912   proto: fix invalid types in hf check routine.


Summary of changes:
 epan/proto.c | 73 +++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 38 insertions(+), 35 deletions(-)