Commit Graph

226 Commits

Author SHA1 Message Date
João Valverde f2218ae5f0 Lemon: Update code and remove cruft
Remove some unused historical files.

Aggressively disable warnings to keep the lemon source
pristine and avoid the maintenance burden for lemon itself.

Lemon has its own lax policy for warnings that doesn't match our
own and they won't accept external patches to remove the
warnings, so just ignore them. Lemon is just executed to generate
code for the Wireshark build and the minor code issues it has
have no influence at runtime.

For lemon generated code we selectively disable some linting
warnings.

Remove patches for lemon and lempar, they are no longer required
with these changes to silence warnings.
2023-01-01 18:18:06 +00:00
Moshe Kaplan 7567432ec4 Add remaining header files to Doxygen
Add @file markers for remaining
header files so that Doxygen will
generate documentation for them.
2021-12-12 03:56:35 +00:00
Adrian Ratiu 61e66c37ab cmake: lemon: allow overriding lemon CC setting
When cross-compiling wireshark the lemon tool should be built
using the host machine compiler to be run on the host. Before
cmake this was done via autotools CC_FOR_BUILD but cmake only
supports one compiler toolchain per build and requires some
workarounds like running cmake twice using separately defined
toolchains.

This gets ugly and complicated fast when considering multiple
toolchains, especially for a simple tool like lemon, so just
allow builds to override the C compiler and wipe the cflags.

This way systems like Gentoo/ChromeOS/Yocto with a properly
setup cross-compile environment can just point to the native
BUILD_CC or similar while minimizing complexity.
2021-08-31 19:19:05 +00:00
Guy Harris c0711693ab Enable -Wredundant-decls.
Add it to the default list of checks, and fix some errors it causes.
(Sadly, it doesn't work in CLang.)
2021-02-14 14:43:42 -08:00
Jaap Keuter 27acec97e9 Lemon: import fresh lemon from upstream
- get latest lemon from upstream (SQLite)
- update and apply the patches
- introduce CC0-1.0 license indication
- update documentation
2020-12-04 08:32:58 +00:00
Gerald Combs f0be7f27d8 Lemon: Squelch an unused parameter warning.
Fixes

... tools\lemon\lemon.c(1630,14): warning C4100: 'argc': unreferenced formal parameter ...

Change-Id: I5cddbbed025e246ddebe9189edbe6fbeea883a7d
Reviewed-on: https://code.wireshark.org/review/35522
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2019-12-26 10:32:37 +00:00
Guy Harris 1d39055ec9 Test C compiler flags with check_c_compiler_flag(), not check_c_linker_flag().
Change-Id: If56a6acf9935838232d6ee86e331361fb076369b
Reviewed-on: https://code.wireshark.org/review/30316
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-21 21:21:41 +00:00
Peter Wu 9f74af24f1 lemon: fix GCC/Clang warnings pre CMake 3.11, silence VSCA warnings
The COMPILE_OPTIONS source file property was introduced with CMake 3.11,
disable warnings via a target property instead (available since 2.8.12).

Disable some VS Code Analysis warnings. These flags seem to be accepted
since VS2015, so they can be added unconditionally.

Change-Id: Idfbf154caf8c1168f1f871a640a25b816a2cfab8
Fixes: v2.9.0rc0-2274-g7ce9081fdc ("lemon: sync with upstream (2018-09-08)")
Reviewed-on: https://code.wireshark.org/review/30298
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-10-21 11:46:40 +00:00
Peter Wu 7ce9081fdc lemon: sync with upstream (2018-09-08)
Changes:
- Drop the old basename modification that was present in the Wireshark
  version of lemon.c. Use a new option available since 2018-04-20
  ("Add the -dDIRECTORY command-line option to LEMON.")
- Redo the static analyzer warning fixes, identifying the root causes
  and adding assertions instead of hiding code with __clang_analyzer__.
- Ignore compiler warnings instead of adding config.h, _U_, extra const
  keywords, unsigned/signed changes, etc.
- Remove lemon.html, it is out-of-date and external links are available.

In order to make future updates easier, document the exact steps that
were followed to create the lemon.c and lempar.c files. Future changes
SHOULD follow the same process.

My process to reach this updated lemon version:
1. Identify previous sync. Found v2.5.2rc0-147-g653af0f6d0 ("lemon: Sync
   with latest trunk.") which seems based on sqlite commit 2b3d584ffe.
2. Check successive Wireshark patches. Identified many non-functional
   changes to silence compiler warnings and static analyzer issues.
   Found one feature (basename) that can be replaced with upstream -d.
3. Write minimal patches and document changes.

Upstream typos and coding style issues (other than trailing whitespace)
were deliberately not fixed to remain as close as possible to upstream.

Change-Id: I606f46dede86e34520f962a9e7163912392aad57
Reviewed-on: https://code.wireshark.org/review/30290
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-21 07:00:05 +00:00
Peter Wu bb2caa2a9f lemon: fix memleak in ReportTable
Building without -DENABLE_ASAN=1 but with -fsanitize=address (as is done
by oss-fuzz) still triggers a memleak report. Closer inspection revealed
that two other members were leaked.

Change-Id: I3d022ac50c554891a73b9380b7879c1a60c3c798
Reviewed-on: https://code.wireshark.org/review/30289
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-21 06:58:32 +00:00
Stig Bjørlykke 6bb5a7af66 lemon: Make it build with __clang_analyzer__ defined
The static function handleswitch() is not compiled with __clang_analyzer__
defined, but it's used in OptInit() without any checks. Change to have
an empty implementation for __clang_analyzer__.

Change-Id: I73da2042ec64fdfa6910c02c059d36db491dc538
Reviewed-on: https://code.wireshark.org/review/28059
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-07 03:58:04 +00:00
Dario Lombardo 4a156da068 Remove autotools build system.
It has been replaced by cmake.

Change-Id: I83a5eddb8645dbbf6bca9f026066d2e995d8e87a
Reviewed-on: https://code.wireshark.org/review/26969
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-18 03:46:17 +00:00
Dario Lombardo 35c83b22c0 lemon: remove leaks in main().
Change-Id: If6693d2ad87fcd1dcceb137d76d890663f83a827
Reviewed-on: https://code.wireshark.org/review/26705
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-04-05 18:52:28 +00:00
Dario Lombardo c95e18333c lemon: remove leak in tplt_open().
Change-Id: I6a13c89e27797f8c8d1e187aef8923b9df0c8ee4
Reviewed-on: https://code.wireshark.org/review/26706
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-04-05 18:51:57 +00:00
Dario Lombardo 02ef13fac7 lemon: remove scan-build warning in errline().
Warning: Argument with 'nonnull' attribute passed null.

Change-Id: Ie46733ae8663161b957acaabbaa2da539018693d
Reviewed-on: https://code.wireshark.org/review/26704
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-04-05 18:51:34 +00:00
Dario Lombardo 60d5edb41c lemon: make some functions static.
Change-Id: I41a78d6cb87223d13854ca4aad4ffdf70daecaf3
Reviewed-on: https://code.wireshark.org/review/26687
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-04 10:00:49 +00:00
Dario Lombardo 8131922b26 lemon: comment out unused OptErr function.
Change-Id: I889c2f0df721d93752c77e6b31ddaa8702ab47bf
Reviewed-on: https://code.wireshark.org/review/26703
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-04 04:12:52 +00:00
Dario Lombardo d7c98ddde7 lemon: skip clang analyzer for more code.
Change-Id: I3c2c0e1581c759fb4eef48008a7d905701958913
Reviewed-on: https://code.wireshark.org/review/26688
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-03-30 19:02:13 +00:00
Dario Lombardo 072e24fa0a lemon: remove unneeded assignment.
Change-Id: Id7bd4b5f7db1c9c797a2f50e7896799a0ad64532
Reviewed-on: https://code.wireshark.org/review/26690
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-03-30 19:02:04 +00:00
Dario Lombardo 4feb47dca2 lemon: remove clang scan warnings.
Add assert and remove some code from scan builds.

Change-Id: I32747d1a61f183e4c918d9f50ec8337eaef47f0d
Reviewed-on: https://code.wireshark.org/review/26483
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-30 07:30:41 +00:00
Anders 653af0f6d0 lemon: Sync with latest trunk.
Change-Id: Iab0d64f675b482eee97b300d419ffa1e8090632e
Reviewed-on: https://code.wireshark.org/review/26676
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-28 16:20:24 +00:00
Anders 85a0646490 lemon: Sync with upstream, Jun 28, 2017
Change-Id: I4c6dbd018302fdf176e955e0e5e735a7aee22b10
Reviewed-on: https://code.wireshark.org/review/26669
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-28 07:10:47 +00:00
Anders 5ef22d4a4b lemon: Align struct s_options with upstream.
Change-Id: I87ce8123a625a643a7c3d9e426f5ce103a670f2a
Reviewed-on: https://code.wireshark.org/review/26666
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-28 04:09:39 +00:00
Anders 036c5a4e6a lemon: Trivial changes to make it easier to compare with upstream.
Change-Id: I1bfac3d39a50b3d2093c66a77280b355e678d427
Reviewed-on: https://code.wireshark.org/review/26664
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-27 20:04:59 +00:00
Dario Lombardo fe71e26af2 spdx: more licenses converted.
Change-Id: I3861061ec261e63b23621799e020e811ed78a343
Reviewed-on: https://code.wireshark.org/review/26333
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07 15:56:44 +00:00
Guy Harris 459bd4646d Don't have CLEAN_FILES variables for the "clean" source files.
Except for the one directory that (currently) has "not yet clean" files,
epan/dissectors, we don't need a separate variable to keep track of the
"clean" source files.

In the cases where not all files were in CLEAN_FILES, put them into the
variable used to enable -Werror or its equivalent.

Change-Id: Ic4119861c1d9e381adfe31e9977e1ac71d623f5b
Reviewed-on: https://code.wireshark.org/review/25830
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-17 02:50:24 +00:00
João Valverde 1097e8020a autotools: Library build products don't need explicit cleaning
Change-Id: I5d68c05f2844d6c9ae486531b189dbf10bc09cff
Reviewed-on: https://code.wireshark.org/review/24484
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-18 22:29:41 +00:00
João Valverde 9764cd0a83 autotools: make maintainer-clean should allow rerunning 'configure'
Change-Id: Iedae94ffefe27b13b1967d69cacb757b5aa4576d
Reviewed-on: https://code.wireshark.org/review/23928
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15 14:17:20 +00:00
Ahmad Fatoum 9d49e13166 Remove superfluous null-checks before strdup/free
NULL checks were removed for following free functions:

- g_free "If mem is NULL it simply returns"
  https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free

- g_slist_free(_full)? "NULL is considered to be the empty list"
  https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html

- g_strfreev "If str_array is NULL, this function simply returns."
  https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev

- g_slice_free "If mem is NULL, this macro does nothing."
  https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free

- g_match_info_free "not NULL... otherwise does nothing"
  https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free

- dfilter_free defined in Wireshark code. Returns early when passed NULL
  epan/dfilter/dfilter.c

They were also removed around calls to g_strdup where applicable:

- g_strdup "If str is NULL it returns NULL."
  https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup

Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04
Reviewed-on: https://code.wireshark.org/review/23406
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15 12:38:51 +00:00
João Valverde 9bba3866ff CMake: Allow user build flags to override default build flags
Autotools has the very useful feature by design of allowing the user
to override the default build flags (you break it you keep it).

Apparently CMake applies COMPILE_OPTIONS target property after
CMAKE_{C,CXX}_FLAGS so that doesn't work here. Prepend our flags to those
variables instead to make it work then.

Specific target flag overrides can still be added with COMPILER_OPTIONS
(e.g: generated files with -Wno-warning) but this is less effective and
then we're back at the point where this overrides user flags. It's less
of a concern though.

Change-Id: I44761a79be4289238e02d4e781fef0099628817b
Reviewed-on: https://code.wireshark.org/review/23675
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-10-13 21:32:18 +00:00
João Valverde d0a91b27f2 plugins: config.h must not be included by public headers
For a sane plugin build environment. Include config.h as the first
header in the .c file instead.

Fix by moving required compiler attribute macros to a new
"ws_attributes.h" API header.

Change-Id: I34f58a927f68c1a0e59686c14d214825149749e1
Reviewed-on: https://code.wireshark.org/review/23400
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-06 08:10:56 +00:00
Alexis La Goutte dcba264a46 lemon: avoid redundant redeclaration of ‘memory_error’ [-Wredundant-decls]
Change-Id: I1fbc11dc433363b659ddba9a77e52ffd4e3968d7
Reviewed-on: https://code.wireshark.org/review/21850
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-31 11:33:19 +00:00
Alexis La Goutte 905e0c08ee lempar: set ParseInit/ParseFinalize static
grammar.c:471:6: warning: no previous prototype for ‘DfilterInit’ [-Wmissing-prototypes]
grammar.c:646:6: warning: no previous prototype for ‘DfilterFinalize’ [-Wmissing-prototypes]
dtd_grammar.c:502:6: warning: no previous prototype for ‘DtdParseInit’ [-Wmissing-prototypes]
dtd_grammar.c:637:6: warning: no previous prototype for ‘DtdParseFinalize’ [-Wmissing-prototypes]

Change-Id: I9c43fb4d5ad50992e8e55163333793b20319aa74
Reviewed-on: https://code.wireshark.org/review/21516
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-05 21:42:28 +00:00
Alexis La Goutte 427c800a9f lemon: fix no previous prototype for ‘memory_error’ [-Wmissing-prototypes]
Change-Id: I5830581c843af41f48bc9645c2be7cf35fa00391
Reviewed-on: https://code.wireshark.org/review/21463
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-02 17:38:53 +00:00
Alexis La Goutte 9ccba0e605 Revert "Make the set of static routines match that in the current tip SQLite."
This reverts commit 96c72df2df.

Generated a lot of warning (-Wmissing-prototypes)
and i try to kept a sync branch on https://github.com/alagoutte/sqlite/tree/wireshark

Change-Id: I42252a6e736f96783a9fa9805b84e525fe11726e
Reviewed-on: https://code.wireshark.org/review/21182
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2017-04-24 07:30:05 +00:00
Guy Harris c2386c5b01 Update to the current lempar.c in the SQLite repository.
Change-Id: I86ca187a7c698541d70bab558c4073fdff28dea3
Reviewed-on: https://code.wireshark.org/review/21108
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-15 07:47:42 +00:00
Guy Harris 96c72df2df Make the set of static routines match that in the current tip SQLite.
This reduces the differences between our lemon.c and SQLite's.

Change-Id: Ie672fa564a43ffe2fae271968accfed2a864bb63
Reviewed-on: https://code.wireshark.org/review/21107
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-15 05:07:57 +00:00
Guy Harris d523f615be Make memory_error() a routine.
That makes the code more like Lemon as distributed.

Note that Lemon, as distributed, at least claims to have a bunch of
stuff "From the file "XXX.{c,h}", which might be the result of lemon.c
being an "amalgamation":

	https://www.sqlite.org/amalgamation.html

although, unlike SQLite, the individual bits of the amalgamation don't
appear to be present in the SQLite Fossil repository, so maybe they've
been permanently glued together.

Change-Id: I361d0d16be0744b127110d7d237fdd84e30b6432
Reviewed-on: https://code.wireshark.org/review/21105
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-15 02:33:52 +00:00
Guy Harris 3bd7671083 Make whitespace match what's checked into the SQLite repository.
They accepted some of our changes, but with no space between "struct
XXX" and "*.  Whatever.

Change-Id: I6b29462dc8b04ebf0822f8512d82f5f8df575447
Reviewed-on: https://code.wireshark.org/review/21101
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-15 01:29:11 +00:00
Alexis La Goutte 867d5cd6b1 lemon: fix this statement may fall through [-Werror=implicit-fallthrough=] found by gcc7
Change-Id: If52bc0092f1baa833e35a9f4c107faf72c3b64d1
Reviewed-on: https://code.wireshark.org/review/20392
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-05 15:14:39 +00:00
Alexis La Goutte a76c6cfa42 lemon: Fix Dereference of null pointer found by Clang analyzer
lemon.c:877:10: warning: Access to field 'lhs' results in a dereference of a null pointer (loaded from field 'startRule')
lemon.c:1141:22: warning: Access to field 'lhs' results in a dereference of a null pointer (loaded from field 'startRule')

it is false positve lem.nrule==0 implies lem.rule==NULL

Change-Id: Id63086990762fbf5195bce34a28f25aeb7a246f7
Reviewed-on: https://code.wireshark.org/review/19445
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-30 00:56:18 +00:00
Alexis La Goutte 60551ea55a Lemon: resync with upstream
lemon: Tue Aug 16 16:46:40 2016
lempar: Tue Dec 6 17:59:05 2016 +0000

a copy of all Wireshark changes are available https://github.com/alagoutte/sqlite/tree/wireshark

Change-Id: I144d0f983e4ac960b5a7a2fd8cd379f6282579f8
Reviewed-on: https://code.wireshark.org/review/15987
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-24 19:35:59 +00:00
Gerald Combs 22d8142ce7 Disable ASAN when building lemon.
If ASAN is enabled, use "-fno-sanitize=all" when building lemon. This
keeps us from having to set ASAN_OPTIONS=detect_leaks=0 in the
environment in order to build Wireshark.

Change-Id: I36f6d1a4f913ecabaf188f4c2b59216c8430d81a
Reviewed-on: https://code.wireshark.org/review/18098
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-10-07 17:54:35 +00:00
Peter Wu 534787e402 cmake: make WERROR_COMMON_FLAGS a normal string
Instead of checking for the boolean "FALSE", just set an empty string.
This avoids the need to check for WERROR_COMMON_FLAGS before using it.

The transformation is the same for all files, remove
"if (WERROR_COMMON_FLAGS)" and "endif()", reindent and add quotes (since
we have a string here and not a list).

Modelines have been added where missing.

Change-Id: I0ab05ae507c51fa77336d49a99a226399cc81b92
Reviewed-on: https://code.wireshark.org/review/17997
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Dario Lombardo <lomato@gmail.com>
2016-09-30 20:08:02 +00:00
João Valverde 640382c743 CMake: Allow setting per target compiler warnings
Setting our compiler warning flags in CMAKE_C_FLAGS does not allow
using different flags per target.

Allow for that possibility by setting the internal WS_WARNINGS_{C,CXX}_FLAGS
and using the COMPILE_OPTIONS property to set them.

This change is just setting mechanism and there should be no difference
in generated warnings.

The check_X_compiler_flag cmake test is changed to test each flag individually.
We need a list, not a space separated string, and the aggregate test is not
significant.

Change-Id: I59fc5cd7e130c7a5e001c598e3df3e13f83a6a25
Reviewed-on: https://code.wireshark.org/review/17150
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-08-23 21:33:09 +00:00
Martin Kaiser c26968434c lemon: use a define for fseek()'s whence parameter
for people who don't immediately understand what fseek(fp, 0, 2) does

Change-Id: I297ba6fd718ef0f09c4d0b29bf433262c3c38435
Reviewed-on: https://code.wireshark.org/review/15976
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-16 19:57:15 +00:00
Pascal Quantin 6baa1b544c Remove Nmake build system
Change-Id: I3bd474f3cda9667dec66426b5729449953df3e61
Reviewed-on: https://code.wireshark.org/review/15777
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2016-06-15 19:21:57 +00:00
Guy Harris 38d39f292e Have MemoryCheck() directly incorporate the error message and exit.
Manually inline memory_error() in MemoryCheck(), so that static
analyzers know that, if MemoryCheck() sees a null pointer, it exists,
and the null pointer isn't subsequently used.

Use MemoryCheck() instead of the one place where we manually checked for
a null pointer and called memory_error().

Change-Id: Id6b0328cfd17cb14ec9d1e461420896a31573c71
Reviewed-on: https://code.wireshark.org/review/15851
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-12 19:18:41 +00:00
Guy Harris 7bbc60c668 Add more memory checks, and use MemoryCheck() for some existing checks.
Always check for malloc() and realloc() failing.  Use MemoryCheck() for
most of the checks - it's a bit cleaner and makes the error message the
same for those checks.

Change-Id: I533153c697b37b85adfa0259c1352efece0b0486
Reviewed-on: https://code.wireshark.org/review/15849
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-12 17:34:47 +00:00
João Valverde 58c7b5548c Minor lemon Makefile.am fixup
Change-Id: I80108d565e40835e9bf3fa58b1999735a45d77f0
Reviewed-on: https://code.wireshark.org/review/14860
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-08 04:38:03 +00:00