CMake: Move clang warnings
Move clang warnings to normal set. Let the CMake compatibility check control the warning. Fix or work-around -Wunreachable warnings in the code.
This commit is contained in:
parent
671bb9f190
commit
09718fb9b3
|
@ -645,6 +645,8 @@ else() # ! MSVC
|
|||
-Wcomma # Clang-only
|
||||
-Wshorten-64-to-32 # Clang-only
|
||||
-Wredundant-decls
|
||||
-Wunreachable-code # Clang-only
|
||||
-Wdocumentation # Clang-only
|
||||
#
|
||||
# Disable errors unconditionally for some static analysis warnings
|
||||
# that are dormant at lower optimizations levels and also
|
||||
|
@ -771,18 +773,13 @@ else() # ! MSVC
|
|||
#
|
||||
-Wcast-align
|
||||
#
|
||||
# Works only with Clang
|
||||
# Doesn't warn of interesting issues. Usually the
|
||||
# duplicated branches are protocol constants that
|
||||
# happen to be equal and are relevant for documentation
|
||||
# and readability and are trivially optimized by the
|
||||
# compiler.
|
||||
#
|
||||
-Wunreachable-code
|
||||
#
|
||||
# Works only with Clang but generates a lot of warnings
|
||||
# (about glib library not using Doxygen)
|
||||
#
|
||||
-Wdocumentation
|
||||
#
|
||||
# Works only with GCC 7
|
||||
#
|
||||
-Wduplicated-branches
|
||||
-Wduplicated-branches # GCC-only
|
||||
#
|
||||
# No longer supported by El Capitan clang on C++
|
||||
# XXX - is this one of those where CMake's check
|
||||
|
|
|
@ -2134,10 +2134,9 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
|||
|
||||
if (err)
|
||||
{
|
||||
gcry_cipher_close(*cipher_hd);
|
||||
REPORT_DISSECTOR_BUG("<IPsec/ESP Dissector> Error in Algorithm %s, Mode %d, gcry_cipher_decrypt failed: %s\n",
|
||||
gcry_cipher_algo_name(crypt_algo_libgcrypt), crypt_mode_libgcrypt, gcry_strerror(err));
|
||||
gcry_cipher_close(*cipher_hd);
|
||||
decrypt_ok = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1308,10 +1308,10 @@ static void dissect_rar(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
|
|||
write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
|
||||
"(RAPID=%u TA=%u Temp C-RNTI=%u) ", rapid, ta, c_rnti);
|
||||
}
|
||||
else {
|
||||
write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
|
||||
"(RAPID=%u) ", rapid);
|
||||
}
|
||||
//else {
|
||||
// write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
|
||||
// "(RAPID=%u) ", rapid);
|
||||
//}
|
||||
}
|
||||
/* Set subheader (+subpdu..) length */
|
||||
proto_item_set_end(subheader_ti, tvb, offset);
|
||||
|
|
|
@ -484,7 +484,7 @@ static int dissect_sftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
|
|||
return offset;
|
||||
}
|
||||
|
||||
static int dissect_sftp_attrs(tvbuff_t *packet_tvb, packet_info *pinfo,
|
||||
static int dissect_sftp_attrs(tvbuff_t *packet_tvb, packet_info *pinfo _U_,
|
||||
int offset, proto_item *msg_type_tree)
|
||||
{
|
||||
wmem_strbuf_t *title = wmem_strbuf_new(wmem_packet_scope(), "SFTP attributes");
|
||||
|
@ -527,8 +527,6 @@ static int dissect_sftp_attrs(tvbuff_t *packet_tvb, packet_info *pinfo,
|
|||
proto_item_set_len(sftp_attrs_tree, offset - offset0);
|
||||
|
||||
return offset - offset0;
|
||||
|
||||
(void)pinfo;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -18,9 +18,13 @@
|
|||
#include <stdio.h>
|
||||
#include <glib.h>
|
||||
#include <assert.h>
|
||||
#include <ws_diag_control.h>
|
||||
#include "dtd.h"
|
||||
#include "dtd_parse.h"
|
||||
|
||||
/* Generated lemon code warns on this. */
|
||||
DIAG_OFF(unreachable-code)
|
||||
|
||||
static dtd_named_list_t* dtd_named_list_new(gchar* name, GPtrArray* list) {
|
||||
dtd_named_list_t* nl = g_new(dtd_named_list_t,1);
|
||||
|
||||
|
|
20
epan/proto.c
20
epan/proto.c
|
@ -8668,7 +8668,7 @@ tmp_fld_check_assert(header_field_info *hfinfo)
|
|||
" but is being displayed as %s",
|
||||
hfinfo->name, hfinfo->abbrev,
|
||||
ftype_name(hfinfo->type), tmp_str);
|
||||
wmem_free(NULL, tmp_str);
|
||||
//wmem_free(NULL, tmp_str);
|
||||
}
|
||||
if (hfinfo->display & BASE_UNIT_STRING) {
|
||||
REPORT_DISSECTOR_BUG("Field '%s' (%s) is a character value (%s) but has a unit string",
|
||||
|
@ -8698,7 +8698,7 @@ tmp_fld_check_assert(header_field_info *hfinfo)
|
|||
REPORT_DISSECTOR_BUG("Field '%s' (%s) is signed (%s) but is being displayed unsigned (%s)",
|
||||
hfinfo->name, hfinfo->abbrev,
|
||||
ftype_name(hfinfo->type), tmp_str);
|
||||
wmem_free(NULL, tmp_str);
|
||||
//wmem_free(NULL, tmp_str);
|
||||
}
|
||||
/* FALL THROUGH */
|
||||
case FT_UINT8:
|
||||
|
@ -8792,7 +8792,7 @@ tmp_fld_check_assert(header_field_info *hfinfo)
|
|||
" but is being displayed as %s",
|
||||
hfinfo->name, hfinfo->abbrev,
|
||||
ftype_name(hfinfo->type), tmp_str);
|
||||
wmem_free(NULL, tmp_str);
|
||||
//wmem_free(NULL, tmp_str);
|
||||
}
|
||||
break;
|
||||
case FT_BYTES:
|
||||
|
@ -8811,7 +8811,7 @@ tmp_fld_check_assert(header_field_info *hfinfo)
|
|||
tmp_str = val_to_str_wmem(NULL, hfinfo->display, hf_display, "(Bit count: %d)");
|
||||
REPORT_DISSECTOR_BUG("Field '%s' (%s) is an byte array but is being displayed as %s instead of BASE_NONE, SEP_DOT, SEP_DASH, SEP_COLON, or SEP_SPACE",
|
||||
hfinfo->name, hfinfo->abbrev, tmp_str);
|
||||
wmem_free(NULL, tmp_str);
|
||||
//wmem_free(NULL, tmp_str);
|
||||
}
|
||||
if (hfinfo->bitmask != 0)
|
||||
REPORT_DISSECTOR_BUG("Field '%s' (%s) is an %s but has a bitmask",
|
||||
|
@ -8831,7 +8831,7 @@ tmp_fld_check_assert(header_field_info *hfinfo)
|
|||
REPORT_DISSECTOR_BUG("Field '%s' (%s) is an %s but is being displayed as %s instead of BASE_NONE",
|
||||
hfinfo->name, hfinfo->abbrev,
|
||||
ftype_name(hfinfo->type), tmp_str);
|
||||
wmem_free(NULL, tmp_str);
|
||||
//wmem_free(NULL, tmp_str);
|
||||
}
|
||||
if (hfinfo->bitmask != 0)
|
||||
REPORT_DISSECTOR_BUG("Field '%s' (%s) is an %s but has a bitmask",
|
||||
|
@ -8850,7 +8850,7 @@ tmp_fld_check_assert(header_field_info *hfinfo)
|
|||
tmp_str = val_to_str_wmem(NULL, hfinfo->display, hf_display, "(Bit count: %d)");
|
||||
REPORT_DISSECTOR_BUG("Field '%s' (%s) is a %s but is being displayed as %s instead of as a time",
|
||||
hfinfo->name, hfinfo->abbrev, ftype_name(hfinfo->type), tmp_str);
|
||||
wmem_free(NULL, tmp_str);
|
||||
//wmem_free(NULL, tmp_str);
|
||||
}
|
||||
if (hfinfo->bitmask != 0)
|
||||
REPORT_DISSECTOR_BUG("Field '%s' (%s) is an %s but has a bitmask",
|
||||
|
@ -8874,7 +8874,7 @@ tmp_fld_check_assert(header_field_info *hfinfo)
|
|||
" but is being displayed as %s",
|
||||
hfinfo->name, hfinfo->abbrev,
|
||||
ftype_name(hfinfo->type), tmp_str);
|
||||
wmem_free(NULL, tmp_str);
|
||||
//wmem_free(NULL, tmp_str);
|
||||
}
|
||||
|
||||
if (hfinfo->bitmask != 0)
|
||||
|
@ -8899,7 +8899,7 @@ tmp_fld_check_assert(header_field_info *hfinfo)
|
|||
" but is being displayed as %s",
|
||||
hfinfo->name, hfinfo->abbrev,
|
||||
ftype_name(hfinfo->type), tmp_str);
|
||||
wmem_free(NULL, tmp_str);
|
||||
//wmem_free(NULL, tmp_str);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -8918,7 +8918,7 @@ tmp_fld_check_assert(header_field_info *hfinfo)
|
|||
" but is being displayed as %s",
|
||||
hfinfo->name, hfinfo->abbrev,
|
||||
ftype_name(hfinfo->type), tmp_str);
|
||||
wmem_free(NULL, tmp_str);
|
||||
//wmem_free(NULL, tmp_str);
|
||||
}
|
||||
if (hfinfo->bitmask != 0)
|
||||
REPORT_DISSECTOR_BUG("Field '%s' (%s) is an %s but has a bitmask",
|
||||
|
@ -8936,7 +8936,7 @@ tmp_fld_check_assert(header_field_info *hfinfo)
|
|||
hfinfo->name, hfinfo->abbrev,
|
||||
ftype_name(hfinfo->type),
|
||||
tmp_str);
|
||||
wmem_free(NULL, tmp_str);
|
||||
//wmem_free(NULL, tmp_str);
|
||||
}
|
||||
if (hfinfo->bitmask != 0)
|
||||
REPORT_DISSECTOR_BUG("Field '%s' (%s) is an %s but has a bitmask",
|
||||
|
|
|
@ -24,11 +24,15 @@
|
|||
#include <stdarg.h>
|
||||
#include <glib.h>
|
||||
#include <assert.h>
|
||||
#include <ws_diag_control.h>
|
||||
#include <wsutil/file_util.h>
|
||||
#include "protobuf_lang_tree.h"
|
||||
#include "protobuf_lang_parser.h"
|
||||
#include "protobuf_lang_scanner_lex.h"
|
||||
|
||||
/* Generated lemon code warns on this. */
|
||||
DIAG_OFF(unreachable-code)
|
||||
|
||||
#define NAME_TO_BE_SET "<NAME_TO_BE_SET>"
|
||||
#define NEED_NOT_NAME "<NEED_NOT_NAME>"
|
||||
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
#include <wsutil/file_util.h>
|
||||
#include <wsutil/str_util.h>
|
||||
|
||||
/* Generated lemon code warns on this. */
|
||||
DIAG_OFF(unreachable-code)
|
||||
|
||||
#define DUMMY void*
|
||||
|
||||
typedef struct _extraction {
|
||||
|
|
|
@ -62,9 +62,9 @@ fill_named_table(gpointer key, gpointer value _U_, gpointer user_data)
|
|||
}
|
||||
html_table->append(QString("<th>%1</th>").arg(title));
|
||||
}
|
||||
title_done:
|
||||
html_table->append("</tr>\n");
|
||||
}
|
||||
title_done:
|
||||
|
||||
html_table->append("<tr>");
|
||||
|
||||
|
|
|
@ -140,6 +140,9 @@ static void AscendParserFree(void *p, void (*freeProc)(void*));
|
|||
#define ascend_debug(...)
|
||||
#endif
|
||||
|
||||
/* Generated lemon code warns on this. */
|
||||
DIAG_OFF(unreachable-code)
|
||||
|
||||
} // %include
|
||||
|
||||
%name AscendParser
|
||||
|
|
Loading…
Reference in New Issue