Commit Graph

9 Commits

Author SHA1 Message Date
Moshe Kaplan f8d48d04d5 Fix misppellings in root and ui directories
Fix misppellings in root and ui directories.
Most of these are comments, but some are in
error messages.
2023-09-26 00:26:25 -04:00
João Valverde 20f6197205 Improve a compiler test and diagnostic control 2023-04-16 15:08:45 +00:00
Joakim Karlsson 47bc2e62e3 LWM: fix error: unknown option [-Werror=pragmas]
epan/dissectors/packet-lwm.c:468:21: error: unknown option after
‘#pragma GCC diagnostic’ kind [-Werror=pragmas]
                     DIAG_OFF_STRINGOP_OVERFLOW()

gcc-warning "stringop-overflow=" was introduced in gcc7.1
https://hackmd.io/@VZ/gcc-warnings
2023-04-14 18:44:04 +00:00
João Valverde e14ef590e3 LWM: Silence false positive stringop-overflow warning (take 2)
```
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c: In function 'dissect_lwm':
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 16 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 32 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 48 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 64 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 80 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 96 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 112 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 128 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 144 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 64 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 80 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 96 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 112 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 128 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 144 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 160 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 176 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 192 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 208 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:464:31: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
D:/a/wireshark/wireshark/build/src/wireshark/epan/dissectors/packet-lwm.c:419:21: note: at offset 224 into destination object 'nwkSecurityVector' of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
```

Ping #18383
2023-04-12 15:40:13 +01:00
João Valverde 90084d8269 Add Wunused-parameter to DIAG_OFF_FLEX() 2023-01-04 15:50:07 +00:00
João Valverde 79c3a77752 Add macros to control lemon diagnostics
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
2022-11-20 10:11:27 +00:00
João Valverde 90fb3ff438 Disable a compiler warning for Flex generated code
The flex+clang combination in the macOS Intel builder generates
-Wdocumentation warnings. Silence those warnings.
2022-11-17 17:36:32 +00:00
João Valverde f6de88707c Add DIAG_WARN() diagnostic macros
This enable the warning at "warning" level (neither ignored nor
an error). This is used to selectively disable -Werror for a section
of code but keep the warning enabled as useful and relevant.

For example it can be used to defer replacing deprecated declarations
and still build with -Werror enabled globally.
2022-10-04 17:35:55 +00:00
João Valverde ca06d7e4fe Add an include sub-directory to the tree
Blind attempt to fix Debian package brokenness managing
headers separately from install rules.

Global public headers that don't fit any of the Wireshark
libraries should be placed in include/.

Eventually the C files in the root dir should be placed somewhere
else as well (like src/) but this is not a priority.

Fixes #17726.
2021-11-12 17:33:13 +00:00