Instead of using tvb_get_bits and proto_tree_add_uint,
use a bitmask in the field info and proto_tree_add_item.
This means that when epan/print.c writes PDML or JSON,
the value written is the correctly masked value (PDML also
includes the unmasked value.)
When proto_tree_add_uint is used, the value written to
PDML and JSON is the original value from the packet buffer,
not properly shifted.
Using a bitmask in the field definition allows us to use
proto_tree_add_item, which means that when print.c writes
PDML and JSON, the value written is the correctly masked
value (PDML also includes the unmasked value.)
When functions like proto_tree_add_uint are used instead,
the value written to PDML and JSON is the original value
from the packet buffer, not properly shifted.
Instead of using tvb_get_bits32 and proto_tree_add_uint,
use a bitmask in the field info and proto_tree_add_item.
This means that when epan/print.c writes PDML or JSON,
the value written is the correctly masked value (PDML also
includes the unmasked value.)
When proto_tree_add_uint is used, the value written to
PDML and JSON is the original value from the packet buffer,
not properly shifted.
It's possible, in the case of errors, for the result of
g_uri_unescape_string not to be valid UTF-8, either if originally
some other encoding was percent-encoded, or if there were errors.
Check for it.
Fix#18658.
Rename flex macros using parenthesis (mostly a style issue):
DIAG_OFF_FLEX -> DIAG_OFF_FLEX()
DIAG_ON_FLEX -> DIAG_ON_FLEX()
Use the same kind of construct with lemon generated code using
DIAG_OFF_LEMON() and DIAG_ON_LEMON(). Use %include and %code
directives to enforce the desired order with generated code
in the middle in between pragmas.
Fix a clang-specific pragma to use DIAG_OFF_CLANG().
DIAG_OFF(unreachable-code) -> DIAG_OFF_CLANG(unreachable-code).
Apparently GCC is ignoring the -Wunreachable flag, that's why
it did not trigger an unknown pragma warning. From [1}:
The -Wunreachable-code has been removed, because it was unstable: it
relied on the optimizer, and so different versions of gcc would warn
about different code. The compiler still accepts and ignores the
command line option so that existing Makefiles are not broken. In some
future release the option will be removed entirely. - Ian
[1] https://gcc.gnu.org/legacy-ml/gcc-help/2011-05/msg00360.html
Windows already requires CMake 3.13. Bump the non-Windows
required version to 3.13 as well, since all our currently
supported Linux distributions have at least 3.13.
RHEL 8 and SUSE Enterprise 15 were initially released with
3.10 and 3.11, but have had updates with much more recent
versions since mid 2021 and mid 2020, respectively.
Add another category for warnings that are worth looking
into.
Split ENABLE_EXTRA_WARNINGS into ENABLE_TODO_WARNINGS and
ENABLE_PEDANTIC_WARNINGS.
Disable pedantic warnings in the CI builds.
Add Clang specific warnings to standard category.
Fix or workaround -Wunreachable warnings.
/Users/buildslave/builds/UfJL1hoT/0/wireshark/wireshark/ui/qt/widgets/qcustomplot.cpp:16020:17: error: HTML tag 'tt' requires an end tag [-Werror,-Wdocumentation-html]
parameter as <tt>QVariant(\ref QCPDataSelection)</tt>. All plottables that weren't touched by \a
~^~~
1 error generated.
Enable -Werror so Clang specific warnings will trigger a build
error and can't be checked-in.
This requires disabling "extra" warnings.
Add explicit ENABLE_WERROR=ON options instead of relying on defaults.
Enable -Qunused-arguments because it may be a useful warning.
Remove -fwrapv because it is implied by -fno-strict-overflow.
Move GCC-specific flag out of if(GCC) condition. Let CMake enable
it automatically.
Add strings with proto_tree_add_item or tvb_get_string_enc;
avoid using tvb_get_raw_bytes_as_string.
Use UTF-8 as the encoding to future-proof, according to
Locomation.
Use tvb_find_line_end() to split the lines, which does almost
all the needed logic and simplifies the code.
Fix#18632
It's is valid for C and C++ so move -Wlogical-op to common
flags.
Remove comment because GCC 4.4.5 is over 12 years old at this time,
assume it is outdated.
Remove warnings included in -Wall and -Wextra to make the command
line less noisy and speed up CMake invocation.
Remove a -Werror=implicit flag. Let errors be controlled exclusively
by -Werror.
Move some -Wno-foo flags that are only relevant with -Wpedantic.
cmake is already in the basic list of packages. "cmake3" is
necessary for RHEL/CentOS 7 (where the "cmake" package is 2.8.12),
but that distribution isn't supported on 4.0 and later.
At the same time, the OpenSUSE 15.4 repository accidentally has
a "cmake3" package which is an earlier version than the "cmake" RPM,
which creates some conflicts when trying to install both.
(https://gitlab.com/wireshark/wireshark-containers/-/jobs/3328997023)
So, don't attempt to install cmake3 anymore.