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

From: "Maynard, Christopher" <Christopher.Maynard@xxxxxxx>
Date: Fri, 21 Oct 2022 23:16:28 +0000
FYI: Guy Harris provided a fix, originally with https://gitlab.com/wireshark/wireshark/-/commit/de50666ec077a0b09f3d61ccd20870a03db52c92 but then more simply with https://gitlab.com/wireshark/wireshark/-/commit/de50666ec077a0b09f3d61ccd20870a03db52c92.

- Chris

From: Wireshark-dev <wireshark-dev-bounces@xxxxxxxxxxxxx> On Behalf Of Fulko Hew
Sent: Thursday, October 20, 2022 12:55 PM
To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
Cc: wi0k@xxxxxxxxxxx
Subject: Re: [Wireshark-dev] can't compile wireshark version 4.0

On Thu, Oct 20, 2022 at 11:22 AM mailto:wi0k@xxxxxxxxxxx <mailto: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).







CONFIDENTIALITY NOTICE: This message is the property of International Game Technology PLC and/or its subsidiaries and may contain proprietary, confidential or trade secret information. This message is intended solely for the use of the addressee. If you are not the intended recipient and have received this message in error, please delete this message from your system. Any unauthorized reading, distribution, copying, or other use of this message or its attachments is strictly prohibited.