Wireshark-dev: Re: [Wireshark-dev] can't compile wireshark version 4.0

From: Fulko Hew <fulko.hew@xxxxxxxxx>
Date: Thu, 20 Oct 2022 12:54:31 -0400


On Thu, Oct 20, 2022 at 11:22 AM wi0k@xxxxxxxxxxx <wi0k@xxxxxxxxxxx> wrote:

I can't compile wireshark version 4.0 on Raspberry Pi ubuntu 22.04

Here is the error from make.

I've attached cmake success and make error logs.txt, CMakeError.log and CMakeOutput.log

[ 84%] Building CXX object ui/qt/CMakeFiles/qtui.dir/sequence_dialog.cpp.o
[ 84%] Building CXX object ui/qt/CMakeFiles/qtui.dir/service_response_time_dialog.cpp.o
[ 84%] Building CXX object ui/qt/CMakeFiles/qtui.dir/show_packet_bytes_dialog.cpp.o
/home/wptracy/wireshark/ui/qt/show_packet_bytes_dialog.cpp: In member function ‘void ShowPacketBytesDialog::symbolizeBuffer(QByteArray&)’:
/home/wptracy/wireshark/ui/qt/show_packet_bytes_dialog.cpp:474:20: error: comparison is always false due to limited range of data type [-Werror=type-limits]
  474 |         if ((ba[i] < '\0' || ba[i] >= ' ') && ba[i] != (char)0x7f && !g_ascii_isprint(ba[i])) {
cc1plus: all warnings being treated as errors


My guess as to what could be wrong according to the error is that
ba[i] < '\0' is 'always false'  because ba (although declared as a QByteArray) is probably
an unsigned byte array, and as such a value can never be less than zero.
So that test will always be false as the error message says.

Now how to fix it is another story.
My first crack at it would be to disable that warning.
My second approach would be to correct that test (as appropriate).