diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2015-11-21 23:48:27 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-12-12 16:21:19 +0000 |
commit | 2aab706c5a5d61c61bbff6e9e36a57afc4ef3be8 (patch) | |
tree | 311fa08b5404d23cc4cfa644c87f84ab7422b61f /ui | |
parent | 95142cf09d4789c9c68108b56f5fbe467108494f (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 'ui')
-rw-r--r-- | ui/gtk/dissector_tables_dlg.c | 2 | ||||
-rw-r--r-- | ui/gtk/drag_and_drop.c | 2 | ||||
-rw-r--r-- | ui/gtk/gui_utils.c | 2 | ||||
-rw-r--r-- | ui/gtk/main.c | 12 | ||||
-rw-r--r-- | ui/tap-rlc-graph.c | 6 |
5 files changed, 11 insertions, 13 deletions
diff --git a/ui/gtk/dissector_tables_dlg.c b/ui/gtk/dissector_tables_dlg.c index aff3936f9e..d400a5d231 100644 --- a/ui/gtk/dissector_tables_dlg.c +++ b/ui/gtk/dissector_tables_dlg.c @@ -156,7 +156,7 @@ decode_proto_add_to_list (const gchar *table_name _U_, ftenum_t selector_type, str = (gchar*)dissector_handle_get_dissector_name(handle); if (str == NULL) { - str = (gchar*)"<Unknown>"; + str = "<Unknown>"; } proto_add_to_list(tree_info, store, str, proto_name); break; diff --git a/ui/gtk/drag_and_drop.c b/ui/gtk/drag_and_drop.c index e7ea594ac6..e1cae02d79 100644 --- a/ui/gtk/drag_and_drop.c +++ b/ui/gtk/drag_and_drop.c @@ -316,7 +316,7 @@ dnd_init(GtkWidget *w) static GtkTargetEntry target_entry[] = { /*{"STRING", 0, DND_TARGET_STRING},*/ /*{"text/plain", 0, DND_TARGET_STRING},*/ - {(gchar *)"text/uri-list", 0, DND_TARGET_URL} + {"text/uri-list", 0, DND_TARGET_URL} }; /* set this window as a dnd destination */ diff --git a/ui/gtk/gui_utils.c b/ui/gtk/gui_utils.c index d00d6095b6..66127274b0 100644 --- a/ui/gtk/gui_utils.c +++ b/ui/gtk/gui_utils.c @@ -1093,7 +1093,7 @@ copy_binary_to_clipboard(const guint8 *data_p, int len) { static GtkTargetEntry target_entry[] = { - {(char *)"application/octet-stream", 0, 0}}; + {"application/octet-stream", 0, 0}}; /* XXX - this is not understood by most applications, * but can be pasted into the better hex editors - is * there something better that we can do? diff --git a/ui/gtk/main.c b/ui/gtk/main.c index c3fe025305..7a40b467dd 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -2231,17 +2231,15 @@ main(int argc, char *argv[]) GSList *disable_heur_slist = NULL; #define OPTSTRING OPTSTRING_CAPTURE_COMMON "C:g:Hh" "jJ:kK:lm:nN:o:P:r:R:St:u:vw:X:Y:z:" -DIAG_OFF(cast-qual) static const struct option long_options[] = { - {(char *)"help", no_argument, NULL, 'h'}, - {(char *)"read-file", required_argument, NULL, 'r' }, - {(char *)"read-filter", required_argument, NULL, 'R' }, - {(char *)"display-filter", required_argument, NULL, 'Y' }, - {(char *)"version", no_argument, NULL, 'v'}, + {"help", no_argument, NULL, 'h'}, + {"read-file", required_argument, NULL, 'r' }, + {"read-filter", required_argument, NULL, 'R' }, + {"display-filter", required_argument, NULL, 'Y' }, + {"version", no_argument, NULL, 'v'}, LONGOPT_CAPTURE_COMMON {0, 0, 0, 0 } }; -DIAG_ON(cast-qual) static const char optstring[] = OPTSTRING; #ifdef HAVE_GRESOURCE diff --git a/ui/tap-rlc-graph.c b/ui/tap-rlc-graph.c index 64175b51dd..20b8a582ca 100644 --- a/ui/tap-rlc-graph.c +++ b/ui/tap-rlc-graph.c @@ -156,7 +156,7 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf, /* This "shouldn't happen", as the graph menu items won't * even be enabled if the selected packet isn't an RLC PDU. */ - *err_msg = (char*)"Selected packet doesn't have an RLC PDU"; + *err_msg = "Selected packet doesn't have an RLC PDU"; *free_err_msg = FALSE; return NULL; } @@ -164,7 +164,7 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf, * to select which session he wants here */ if (th.num_hdrs>1){ /* Can only handle a single RLC channel yet */ - *err_msg = (char*)"The selected packet has more than one LTE RLC channel in it."; + *err_msg = "The selected packet has more than one LTE RLC channel in it."; *free_err_msg = FALSE; return NULL; } @@ -294,7 +294,7 @@ gboolean rlc_graph_segment_list_get(capture_file *cf, struct rlc_graph *g, gbool remove_tap_listener(g); if (g->last_segment == NULL) { - *err_string = (char*)"No packets found"; + *err_string = "No packets found"; *free_err_string = FALSE; return FALSE; } |