aboutsummaryrefslogtreecommitdiffstats
path: root/ws_diag_control.h
AgeCommit message (Collapse)AuthorFilesLines
2018-09-11Revert "Make versions of DIAG_OFF() and DIAG_ON() for GCC 4.2 through 4.5."Guy Harris1-72/+14
This reverts commit f6b8bc39c66c878ff25a4f48fff382f8775a2711. 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-11Make versions of DIAG_OFF() and DIAG_ON() for GCC 4.2 through 4.5.Guy Harris1-14/+72
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-10Fix what seems like a copy-paste error.João Valverde1-1/+1
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-09Revert "Try unconditionally using the pragmas in Clang."Guy Harris1-2/+2
This reverts commit 051efd105a8404093139dd4a54620c98c4ff170e. 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-09Try unconditionally using the pragmas in Clang.Guy Harris1-2/+2
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-05-18Older versions of Clang don't understand -Wpedantic.Guy Harris1-0/+23
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-13Suppress -Wshadow warnings in Bison-generated code.Guy Harris1-13/+13
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-03-21Fix case.Guy Harris1-1/+1
Change-Id: I328aae5396cdd071f2c87cded46b8eb747e61dec Reviewed-on: https://code.wireshark.org/review/26582 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-28flex: add also (-W)unreachable-code to ignore warning (for flex generate file)Alexis La Goutte1-1/+4
Change-Id: I09ab6d91b45113432255cb20ae30440ea0438b23 Reviewed-on: https://code.wireshark.org/review/25984 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-28Squelch some Visual Studio Code Analyzer warnings in Flex-generated scanners.Guy Harris1-1/+14
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-24Suppress some warnings caused by a Berkeley YACC bug/misfeature.Guy Harris1-0/+29
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-17Yet Another Narrowing Warning to suppress.Guy Harris1-2/+4
Change-Id: I6ec0a04a0ad074849f447164270a7ff4851b698f Reviewed-on: https://code.wireshark.org/review/25839 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-16Use DIAG_OFF_FLEX/DIAG_ON_FLEX more consistently.Guy Harris1-5/+39
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-16Add DIAG_OFF_FLEX and DIAG_ON_FLEX for use in Flex scanners.Guy Harris1-1/+29
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-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
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>
2017-11-09Start using SPDX license identifiers.Gerald Combs1-13/+2
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-10-27Clean up a bit.Guy Harris1-24/+31
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-26Move the compiler version tests to ws_compiler_tests.h and use them elsewhere.Guy Harris1-27/+31
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-04-05A bunch of "{Mac} OS X" -> "macOS" changes.Guy Harris1-3/+3
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>
2016-05-22Add clang-specific DIAG_OFF pragmaJoão Valverde1-0/+9
Change-Id: I7e02ca86122e3fe8a1c2db9d53b718e6e23c4e98 Reviewed-on: https://code.wireshark.org/review/15521 Reviewed-by: João Valverde <j@v6e.pt>
2016-05-22Revert "ws80211: Disable shorten-64-to-32."João Valverde1-11/+1
This reverts commit b8f90de70efa2d271274fbb48df12737f6eddd12. Change-Id: Ic7eaf288d1937a986c2ec85ba43a94ac20b6e12e Reviewed-on: https://code.wireshark.org/review/15520 Reviewed-by: João Valverde <j@v6e.pt>
2016-04-04Include ws_diag_control.h in config.hJoão Valverde1-0/+107
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>