aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2022-11-17 08:52:28 +0000
committerJoão Valverde <j@v6e.pt>2022-11-17 10:57:52 +0000
commit5754fdf289d3bbd8a07f13b7ea5c974e85ca130a (patch)
treeb8d90bf3c9d2e68539c4aa8f698d98bf78651cf6
parentcfbe898dcc54e302954afab3d09829797dbdb564 (diff)
tfshark: Enable -Werror and fix compiler warnings
Fix a -Wunreachable warning.
-rw-r--r--CMakeLists.txt1
-rw-r--r--tfshark.c11
2 files changed, 7 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e1d58f034..c400c895b0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3711,6 +3711,7 @@ set(CLEAN_C_FILES
${dumpcap_FILES}
${wireshark_FILES}
${tshark_FILES}
+ ${tfshark_FILES}
${rawshark_FILES}
${dftest_FILES}
${randpkt_FILES}
diff --git a/tfshark.c b/tfshark.c
index 52278f30e4..ad5a4a1b5d 100644
--- a/tfshark.c
+++ b/tfshark.c
@@ -2014,11 +2014,8 @@ write_finale(void)
}
cf_status_t
-cf_open(capture_file *cf, const char *fname, unsigned int type, gboolean is_tempfile, int *err)
+cf_open(capture_file *cf, const char *fname, unsigned int type, gboolean is_tempfile, int *err _U_)
{
- gchar *err_info;
- char err_msg[2048+1];
-
/* The open isn't implemented yet. Fill in the information for this file. */
/* Create new epan session for dissection. */
@@ -2055,10 +2052,14 @@ cf_open(capture_file *cf, const char *fname, unsigned int type, gboolean is_temp
return CF_OK;
/* fail: */
+/*
+ gchar *err_info;
+ char err_msg[2048+1];
snprintf(err_msg, sizeof err_msg,
cf_open_error_message(*err, err_info, FALSE, cf->cd_t), fname);
cmdarg_err("%s", err_msg);
return CF_ERROR;
+*/
}
static void
@@ -2085,7 +2086,7 @@ show_print_file_io_error(int err)
}
}
-static const char *
+static const char * _U_
cf_open_error_message(int err, gchar *err_info _U_, gboolean for_writing,
int file_type _U_)
{