Commit Graph

22 Commits

Author SHA1 Message Date
Guy Harris 4207660996 Revert "Make versions of DIAG_OFF() and DIAG_ON() for GCC 4.2 through 4.5."
This reverts commit f6b8bc39c6.

Reason for revert: prior to 4.6 or so, the pragmas didn't work as well,
e.g. they couldn't be used inside a function; we depend on them being
usable within a function.

Change-Id: I7a7a0c08a2aca553233c237b8b6c43115095804e
Reviewed-on: https://code.wireshark.org/review/29610
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-11 18:54:02 +00:00
Guy Harris f6b8bc39c6 Make versions of DIAG_OFF() and DIAG_ON() for GCC 4.2 through 4.5.
The macOS buildbot is currently using llvm-gcc, which is based on GCC
4.2.

Change-Id: I8497243333410380e1d0bc7fa35bccbf841cada1
Reviewed-on: https://code.wireshark.org/review/29596
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-11 07:31:31 +00:00
João Valverde ce3d7840c1 Fix what seems like a copy-paste error.
Change-Id: I084824c57f1eb61189b337ae3e4786d1d8a88707
Reviewed-on: https://code.wireshark.org/review/29525
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-10 03:49:13 +00:00
Guy Harris ed2f332aa3 Revert "Try unconditionally using the pragmas in Clang."
This reverts commit 051efd105a.

Reason for revert: The Clang on the macOS buildbot is 3.1, so it should
have been using the _Pragmas; perhaps it "supports" them but they don't
actually *work*, or perhaps something else is wrong.

Change-Id: Id5c3365875c694e6bd4f1a4d8d92e7581cd4585f
Reviewed-on: https://code.wireshark.org/review/29522
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-09 21:58:21 +00:00
Guy Harris 051efd105a Try unconditionally using the pragmas in Clang.
This should test whether the macOS buildbot Clang really *does* support
them, in which case we should use them, or not.

Change-Id: I52b7b9c450b5f7ba09df72a56ddb91b5750196dc
Reviewed-on: https://code.wireshark.org/review/29521
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-09 21:14:40 +00:00
Guy Harris b1de8c87a1 Older versions of Clang don't understand -Wpedantic.
Define DIAG_OFF_PEDANTIC and DIAG_ON_PEDANTIC, and have it do nothing on
Clang prior to 4.0.

Change-Id: Ic6b2e607659db66f3210401024bf3f2239665506
Reviewed-on: https://code.wireshark.org/review/27649
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-18 22:31:05 +00:00
Guy Harris b55713dccb Suppress -Wshadow warnings in Bison-generated code.
Apparently, some versions of Bison also generate global generations of
yylval, or its appropriately-prefixed equivalent, in pure parsers.
Suppress -Wshadow in Bison-generated code as well as Berkeley
YACC-generated code.

Change-Id: I7b3e6260d338cd8f0c9eea9d7cf248f1ac65c755
Reviewed-on: https://code.wireshark.org/review/27484
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-13 07:25:54 +00:00
Guy Harris 67416033b0 Fix case.
Change-Id: I328aae5396cdd071f2c87cded46b8eb747e61dec
Reviewed-on: https://code.wireshark.org/review/26582
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-21 05:35:17 +00:00
Alexis La Goutte 9226ea8dee flex: add also (-W)unreachable-code to ignore warning (for flex generate file)
Change-Id: I09ab6d91b45113432255cb20ae30440ea0438b23
Reviewed-on: https://code.wireshark.org/review/25984
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-28 21:47:34 +00:00
Guy Harris 48a4ed1058 Squelch some Visual Studio Code Analyzer warnings in Flex-generated scanners.
Hopefully this filters out stuff about which we can't do very much
(other than send off a Flex fix and wait for it to be accepted and end
up in a WinFlexBison package), making it easier to find the stuff about
which we *can* directly do something (i.e., problems in code *we* wrote).

Change-Id: I9dec0389c3e126697acb307d30a823b9b285ef45
Reviewed-on: https://code.wireshark.org/review/26164
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-28 04:13:52 +00:00
Guy Harris c0b2d82fc4 Suppress some warnings caused by a Berkeley YACC bug/misfeature.
Berkeley YACC generates a global declaration of yylval, or the
appropriately prefixed version of yylval, in the .h file, *even though
it's been told to generate a pure parser, meaning it doesn't have any
global variables*.  Bison doesn't do this.

That causes a warning due to the local declaration in the parser
shadowing the global declaration.

So, if this is Berkeley YACC, and we have _Pragma, and have pragmas to
suppress diagnostics, we use it to turn off -Wshadow warnings.

Change-Id: Ia3fecd99fa18ca9b85f6b25f53ed36c60730fad9
Reviewed-on: https://code.wireshark.org/review/26080
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-24 13:25:04 +00:00
Guy Harris 86f2ff6ec0 Yet Another Narrowing Warning to suppress.
Change-Id: I6ec0a04a0ad074849f447164270a7ff4851b698f
Reviewed-on: https://code.wireshark.org/review/25839
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-17 19:37:23 +00:00
Guy Harris 72b57ac4ef Use DIAG_OFF_FLEX/DIAG_ON_FLEX more consistently.
Add warning C4267 (size_t to int conversion) with MSVC to DIAG_OFF_FLEX.

Addd -Wshorten-64-to-32 with Clang and GCC to DIAG_OFF_FLEX.

Don't explicitly use #pragma to turn off warnings; use DIAG_OFF_FLEX for
all of them.

If we use DIAG_OFF_FLEX, use DIAG_ON_FLEX, even if we have no section of
entirely included code at the end.

Change-Id: Ibfd44e8954704e9a8bcb1bd8e54f31d28357fffb
Reviewed-on: https://code.wireshark.org/review/25817
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-16 19:54:16 +00:00
Guy Harris 8bc1c6e3e8 Add DIAG_OFF_FLEX and DIAG_ON_FLEX for use in Flex scanners.
DIAG_OFF_FLEX turns off all warnings that we want to disable for
Flex-generated code due to some versions of Flex generating code that
triggers those warnings.

DIAG_ON_FLEX restores those warnings, so we do the checks for code that
*we* wrote.

Use them in .l files.

Change-Id: I613a20309a30cd4c61111a1edbe27a5d05fcbf59
Reviewed-on: https://code.wireshark.org/review/25815
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-16 10:35:10 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Gerald Combs 775bbbcded Start using SPDX license identifiers.
A while back Graham pointed out the SPDX project (spdx.org), which is
working on standardizing license specifications:

https://www.wireshark.org/lists/wireshark-dev/201509/msg00119.html

Appendix V of the specification describes a short identifier
(SPDX-License-Identifier) that you can use in place of boilerplate in
your source files:

https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b

Start the conversion process with our top-level C and C++ files.

Change-Id: Iba1d835776714deb6285e2181e8ca17f95221878
Reviewed-on: https://code.wireshark.org/review/24302
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-09 20:03:51 +00:00
Guy Harris 42a9e893fb Clean up a bit.
If we're using Clang, use either _Pragma("clang diagnostic XXX") or
nothing; don't use _Pragma("GCC diagnostic XXX").  If we're using
something other than Clang that is, or claims to be, GCC, use
_Pragma("GCC diagnostic XXX") or nothing.

Explain why we're only using _Pragma("GCC diagnostic XXX") with GCC 4.8
or later, even though it's supported in GCC 4.2 and later, and even
though 4.6 an later support _Pragma("GCC diagnostic {push,pop}").

Change-Id: I7a5f46ec419b945663d473cb4ae435ab7fdcf0ef
Reviewed-on: https://code.wireshark.org/review/24096
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-27 02:01:03 +00:00
Guy Harris a0973d0f94 Move the compiler version tests to ws_compiler_tests.h and use them elsewhere.
While we're at it, sort some header file lists, and clean up white
space.

Change-Id: If737dda45334fedf1df7295d8719ad9381daf7a1
Reviewed-on: https://code.wireshark.org/review/24089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-26 22:01:16 +00:00
Guy Harris 357cfd3b03 A bunch of "{Mac} OS X" -> "macOS" changes.
Avoid anachronisms, however; there was no "macOS 10.0" or even "OS X
10.0", for example.  It was "Mac OS X" until 10.8 (although 10.7 was
sometimes called "OS X" and sometimes called "Mac OS X"), and it was "OS
X" from 10.8 to 10.11.

Change-Id: Ie4a848997dcc6c45c2245c1fb84ec526032375c3
Reviewed-on: https://code.wireshark.org/review/20933
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-05 19:16:22 +00:00
João Valverde 1140b1151e Add clang-specific DIAG_OFF pragma
Change-Id: I7e02ca86122e3fe8a1c2db9d53b718e6e23c4e98
Reviewed-on: https://code.wireshark.org/review/15521
Reviewed-by: João Valverde <j@v6e.pt>
2016-05-22 04:55:47 +00:00
João Valverde 77fd31e60a Revert "ws80211: Disable shorten-64-to-32."
This reverts commit b8f90de70e.

Change-Id: Ic7eaf288d1937a986c2ec85ba43a94ac20b6e12e
Reviewed-on: https://code.wireshark.org/review/15520
Reviewed-by: João Valverde <j@v6e.pt>
2016-05-22 04:55:34 +00:00
João Valverde ecb4dc396e Include ws_diag_control.h in config.h
Change-Id: Ia394071710ecda3b0e6686a51fbca45a8ff20317
Reviewed-on: https://code.wireshark.org/review/14749
Petri-Dish: João Valverde <j@v6e.pt>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-04 23:05:31 +00:00