aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.h
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2015-11-21 23:48:27 +0000
committerMichael Mann <mmann78@netscape.net>2015-12-12 16:21:19 +0000
commit2aab706c5a5d61c61bbff6e9e36a57afc4ef3be8 (patch)
tree311fa08b5404d23cc4cfa644c87f84ab7422b61f /capture_opts.h
parent95142cf09d4789c9c68108b56f5fbe467108494f (diff)
Remove -Wwrite-strings compiler flag
The "-Wwrite-strings" flag produces nuisance warnings. These warnings are not useful, they're impossible to fix in a sane way and therefore are being handled with casts of static strings to (char *). This just moves the warning to [-Wcast-qual] and a compiler pragma is in turn required (and used) to squelch that warning. Remove the Wwrite-strings warning. Let that responsibility fall on the programmer (as is done by casting). Change-Id: I5a44dfd9decd6d80797a521a3373593074962fb5 Reviewed-on: https://code.wireshark.org/review/12162 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'capture_opts.h')
-rw-r--r--capture_opts.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/capture_opts.h b/capture_opts.h
index 520a0e1e45..eda550e7c9 100644
--- a/capture_opts.h
+++ b/capture_opts.h
@@ -79,7 +79,7 @@ extern "C" {
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
#define LONGOPT_BUFFER_SIZE \
- {(char *)"buffer-size", required_argument, NULL, 'B'},
+ {"buffer-size", required_argument, NULL, 'B'},
#define OPTSTRING_B "B:"
#else
#define LONGOPT_BUFFER_SIZE
@@ -87,7 +87,7 @@ extern "C" {
#endif
#ifdef HAVE_PCAP_CREATE
-#define LONGOPT_MONITOR_MODE {(char *)"monitor-mode", no_argument, NULL, 'I'},
+#define LONGOPT_MONITOR_MODE {"monitor-mode", no_argument, NULL, 'I'},
#define OPTSTRING_I "I"
#else
#define LONGOPT_MONITOR_MODE
@@ -95,20 +95,20 @@ extern "C" {
#endif
#define LONGOPT_CAPTURE_COMMON \
- {(char *)"capture-comment", required_argument, NULL, LONGOPT_NUM_CAP_COMMENT}, \
- {(char *)"autostop", required_argument, NULL, 'a'}, \
- {(char *)"ring-buffer", required_argument, NULL, 'b'}, \
+ {"capture-comment", required_argument, NULL, LONGOPT_NUM_CAP_COMMENT}, \
+ {"autostop", required_argument, NULL, 'a'}, \
+ {"ring-buffer", required_argument, NULL, 'b'}, \
LONGOPT_BUFFER_SIZE \
- {(char *)"list-interfaces", no_argument, NULL, 'D'}, \
- {(char *)"interface", required_argument, NULL, 'i'}, \
+ {"list-interfaces", no_argument, NULL, 'D'}, \
+ {"interface", required_argument, NULL, 'i'}, \
LONGOPT_MONITOR_MODE \
- {(char *)"list-data-link-types", no_argument, NULL, 'L'}, \
- {(char *)"no-promiscuous-mode", no_argument, NULL, 'p'}, \
- {(char *)"snapshot-length", required_argument, NULL, 's'}, \
- {(char *)"linktype", required_argument, NULL, 'y'}, \
- {(char *)"disable-protocol", required_argument, NULL, LONGOPT_DISABLE_PROTOCOL }, \
- {(char *)"enable-heuristic", required_argument, NULL, LONGOPT_ENABLE_HEURISTIC }, \
- {(char *)"disable-heuristic", required_argument, NULL, LONGOPT_DISABLE_HEURISTIC },
+ {"list-data-link-types", no_argument, NULL, 'L'}, \
+ {"no-promiscuous-mode", no_argument, NULL, 'p'}, \
+ {"snapshot-length", required_argument, NULL, 's'}, \
+ {"linktype", required_argument, NULL, 'y'}, \
+ {"disable-protocol", required_argument, NULL, LONGOPT_DISABLE_PROTOCOL }, \
+ {"enable-heuristic", required_argument, NULL, LONGOPT_ENABLE_HEURISTIC }, \
+ {"disable-heuristic", required_argument, NULL, LONGOPT_DISABLE_HEURISTIC },
#define OPTSTRING_CAPTURE_COMMON \
"a:" OPTSTRING_A "b:" OPTSTRING_B "c:Df:i:" OPTSTRING_I "Lps:y:"