diff options
33 files changed, 120 insertions, 37 deletions
diff --git a/Makefile.am b/Makefile.am index 19ecbbcd96..c742ab0019 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,6 +25,10 @@ ACLOCAL_AMFLAGS = `./aclocal-flags` INCLUDES= @LUA_INCLUDES@ +if USING_GCC +AM_CFLAGS = -Werror +endif + # # This is a hideous hack. # diff --git a/capture_sync.c b/capture_sync.c index 4d2120c58d..4b67d0cd58 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -451,7 +451,7 @@ sync_pipe_start(capture_options *capture_opts) { eth_close(1); dup(sync_pipe[PIPE_WRITE]); eth_close(sync_pipe[PIPE_READ]); - execv(exename, argv); + execv(exename, (gpointer)argv); g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s", exename, strerror(errno)); sync_pipe_errmsg_to_parent(errmsg, ""); diff --git a/codecs/Makefile.am b/codecs/Makefile.am index 6eb1a4c056..a68fd61a63 100644 --- a/codecs/Makefile.am +++ b/codecs/Makefile.am @@ -21,6 +21,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +if USING_GCC +AM_CFLAGS = -Werror +endif noinst_LIBRARIES = libcodec.a diff --git a/configure.in b/configure.in index 4b0a700b81..e9602ad593 100644 --- a/configure.in +++ b/configure.in @@ -174,6 +174,9 @@ else AC_MSG_RESULT(no) fi +# Create the USING_GCC variable for use in Makefile.am files +AM_CONDITIONAL(USING_GCC, test "x$GCC" != "x") + # # Add any platform-specific compiler flags needed. # @@ -379,14 +379,15 @@ cf_read(capture_file *cf) char errmsg_errno[1024+1]; gchar err_str[2048+1]; gint64 data_offset; - progdlg_t *progbar = NULL; + progdlg_t *volatile progbar = NULL; gboolean stop_flag; - gint64 size, file_pos; - float progbar_val; + volatile gint64 size; + gint64 file_pos; + volatile float progbar_val; GTimeVal start_time; gchar status_str[100]; - gint64 progbar_nextstep; - gint64 progbar_quantum; + volatile gint64 progbar_nextstep; + volatile gint64 progbar_quantum; dfilter_t *dfcode; /* Compile the current display filter. @@ -619,11 +620,11 @@ cf_start_tail(capture_file *cf, const char *fname, gboolean is_tempfile, int *er } cf_read_status_t -cf_continue_tail(capture_file *cf, int to_read, int *err) +cf_continue_tail(capture_file *cf, volatile int to_read, int *err) { gint64 data_offset = 0; gchar *err_info; - int newly_displayed_packets = 0; + volatile int newly_displayed_packets = 0; dfilter_t *dfcode; /* Compile the current display filter. diff --git a/plugins/agentx/Makefile.am b/plugins/agentx/Makefile.am index b0825e6f66..b1cb3737d9 100644 --- a/plugins/agentx/Makefile.am +++ b/plugins/agentx/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = agentx.la diff --git a/plugins/artnet/Makefile.am b/plugins/artnet/Makefile.am index 50a79d716a..e0d3ff7d1c 100644 --- a/plugins/artnet/Makefile.am +++ b/plugins/artnet/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = artnet.la diff --git a/plugins/asn1/Makefile.am b/plugins/asn1/Makefile.am index 7f84697be6..e63a570096 100644 --- a/plugins/asn1/Makefile.am +++ b/plugins/asn1/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = asn1.la diff --git a/plugins/ciscosm/Makefile.am b/plugins/ciscosm/Makefile.am index 8faf3ce6ac..a915b4bbe0 100644 --- a/plugins/ciscosm/Makefile.am +++ b/plugins/ciscosm/Makefile.am @@ -27,6 +27,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = ciscosm.la diff --git a/plugins/docsis/Makefile.am b/plugins/docsis/Makefile.am index a788f053c4..10816545c0 100644 --- a/plugins/docsis/Makefile.am +++ b/plugins/docsis/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = docsis.la diff --git a/plugins/enttec/Makefile.am b/plugins/enttec/Makefile.am index a20d4127ae..8f0fa03315 100644 --- a/plugins/enttec/Makefile.am +++ b/plugins/enttec/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = enttec.la diff --git a/plugins/gryphon/Makefile.am b/plugins/gryphon/Makefile.am index 9698546133..bd8fba3b6f 100644 --- a/plugins/gryphon/Makefile.am +++ b/plugins/gryphon/Makefile.am @@ -28,6 +28,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = gryphon.la diff --git a/plugins/h223/Makefile.am b/plugins/h223/Makefile.am index 1b5120e371..c965b25742 100644 --- a/plugins/h223/Makefile.am +++ b/plugins/h223/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = h223.la diff --git a/plugins/h223/packet-h223.c b/plugins/h223/packet-h223.c index 1543dfd1d7..4a20a7b1d0 100644 --- a/plugins/h223/packet-h223.c +++ b/plugins/h223/packet-h223.c @@ -716,7 +716,7 @@ static void dissect_mux_al_pdu( tvbuff_t *tvb, * end_of_mux_sdu true if this is a segmentable VC and this is the last * fragment in an SDU */ -static void dissect_mux_sdu_fragment(tvbuff_t *next_tvb, +static void dissect_mux_sdu_fragment(tvbuff_t *volatile next_tvb, packet_info *pinfo, guint32 pkt_offset, proto_tree *pdu_tree, @@ -790,7 +790,7 @@ static void dissect_mux_sdu_fragment(tvbuff_t *next_tvb, dissect_mux_al_pdu(next_tvb, pinfo, vc_tree,/* subcircuit,*/ lc_params ); } } else { - call_dissector(data_handle,next_tvb,pinfo,vc_tree); + call_dissector(data_handle,next_tvb,pinfo,vc_tree); } } diff --git a/plugins/irda/Makefile.am b/plugins/irda/Makefile.am index a3229a8efc..47efd1cc48 100644 --- a/plugins/irda/Makefile.am +++ b/plugins/irda/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = irda.la diff --git a/plugins/lwres/Makefile.am b/plugins/lwres/Makefile.am index d05ff7464d..b23636f5a6 100644 --- a/plugins/lwres/Makefile.am +++ b/plugins/lwres/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = lwres.la diff --git a/plugins/megaco/Makefile.am b/plugins/megaco/Makefile.am index 91f2495ef0..344f7c06a1 100644 --- a/plugins/megaco/Makefile.am +++ b/plugins/megaco/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = megaco.la diff --git a/plugins/megaco/packet-megaco.c b/plugins/megaco/packet-megaco.c index d5b2d270be..6d57b285ca 100644 --- a/plugins/megaco/packet-megaco.c +++ b/plugins/megaco/packet-megaco.c @@ -215,8 +215,6 @@ dissect_megaco_TerminationStatedescriptor(tvbuff_t *tvb, proto_tree *tree, gint static void dissect_megaco_Localdescriptor(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint tvb_next_offset, gint tvb_current_offset); static void -dissect_megaco_Remotedescriptor(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint tvb_next_offset, gint tvb_current_offset); -static void dissect_megaco_LocalControldescriptor(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint tvb_next_offset, gint tvb_current_offset); static void dissect_megaco_Packagesdescriptor(tvbuff_t *tvb, proto_tree *tree, gint tvb_next_offset, gint tvb_current_offset); @@ -1547,7 +1545,7 @@ dissect_megaco_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *megaco_tree, } static void -dissect_megaco_h324_h223caprn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *megaco_tree, gint offset, gint len, gchar *msg) +dissect_megaco_h324_h223caprn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *megaco_tree, gint offset _U_, gint len, gchar *msg) { guint8 *buf = ep_alloc(10240); asn1_ctx_t actx; @@ -2748,27 +2746,7 @@ dissect_megaco_Localdescriptor(tvbuff_t *tvb, proto_tree *megaco_mediadescriptor call_dissector(sdp_handle, next_tvb, pinfo, megaco_localdescriptor_tree); } } -static void -dissect_megaco_Remotedescriptor(tvbuff_t *tvb, proto_tree *megaco_mediadescriptor_tree,packet_info *pinfo, gint tvb_next_offset, gint tvb_current_offset) -{ - gint tokenlen; - tvbuff_t *next_tvb; - - - proto_tree *megaco_Remotedescriptor_tree, *megaco_Remotedescriptor_ti; - - tokenlen = 0; - - tokenlen = tvb_next_offset - tvb_current_offset; - - megaco_Remotedescriptor_ti = proto_tree_add_item(megaco_mediadescriptor_tree,hf_megaco_Remote_descriptor,tvb,tvb_current_offset,tokenlen, FALSE); - megaco_Remotedescriptor_tree = proto_item_add_subtree(megaco_Remotedescriptor_ti, ett_megaco_Remotedescriptor); - if ( tokenlen > 3 ){ - next_tvb = tvb_new_subset(tvb, tvb_current_offset, tokenlen, tokenlen); - call_dissector(sdp_handle, next_tvb, pinfo, megaco_Remotedescriptor_tree); - } -} /* * localControlDescriptor = LocalControlToken LBRKT localParm * *(COMMA localParm) RBRKT diff --git a/plugins/mgcp/Makefile.am b/plugins/mgcp/Makefile.am index 90352a2375..02e8593f9f 100644 --- a/plugins/mgcp/Makefile.am +++ b/plugins/mgcp/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = mgcp.la diff --git a/plugins/opsi/Makefile.am b/plugins/opsi/Makefile.am index 2026fe47a0..37fa0e3faf 100644 --- a/plugins/opsi/Makefile.am +++ b/plugins/opsi/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = opsi.la diff --git a/plugins/pcli/Makefile.am b/plugins/pcli/Makefile.am index 77ed754b08..368b8f7e29 100644 --- a/plugins/pcli/Makefile.am +++ b/plugins/pcli/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = pcli.la diff --git a/plugins/profinet/Makefile.am b/plugins/profinet/Makefile.am index 4212fce1d2..219f3850db 100644 --- a/plugins/profinet/Makefile.am +++ b/plugins/profinet/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = profinet.la diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c index c652e6b7d6..777728a7d0 100644 --- a/plugins/profinet/packet-dcerpc-pn-io.c +++ b/plugins/profinet/packet-dcerpc-pn-io.c @@ -4497,7 +4497,7 @@ indexReservedForProfiles(guint16 u16Index) if(u16Index >= 0xf400 && u16Index <= 0xf7ff) { return "Reserved for Profiles (API specific)"; } - if(u16Index >= 0xfc00 && u16Index <= 0xffff) { + if(u16Index >= 0xfc00 /* up to 0xffff */) { return "Reserved for Profiles (device specific)"; } diff --git a/plugins/profinet/packet-dcom-cba-acco.c b/plugins/profinet/packet-dcom-cba-acco.c index 883be61778..b7b004c96f 100644 --- a/plugins/profinet/packet-dcom-cba-acco.c +++ b/plugins/profinet/packet-dcom-cba-acco.c @@ -330,7 +330,7 @@ GList *cba_pdevs; /* as we are a plugin, we cannot get this from libwireshark! */ const true_false_string acco_flags_set_truth = { "Set", "Not set" }; - +#if 0 static void cba_connection_dump(cba_connection_t *conn, const char *role) { @@ -356,7 +356,6 @@ cba_connection_dump(cba_connection_t *conn, const char *role) } -#if 0 static void cba_object_dump(void) { diff --git a/plugins/rlm/Makefile.am b/plugins/rlm/Makefile.am index bb12359e02..8a6d01632e 100644 --- a/plugins/rlm/Makefile.am +++ b/plugins/rlm/Makefile.am @@ -27,6 +27,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = rlm.la diff --git a/plugins/rtnet/Makefile.am b/plugins/rtnet/Makefile.am index 86d4d33110..4ec2a58de5 100644 --- a/plugins/rtnet/Makefile.am +++ b/plugins/rtnet/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = rtnet.la diff --git a/plugins/rudp/Makefile.am b/plugins/rudp/Makefile.am index 13fda2b00e..6c07e7f538 100644 --- a/plugins/rudp/Makefile.am +++ b/plugins/rudp/Makefile.am @@ -27,6 +27,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = rudp.la diff --git a/plugins/sbus/Makefile.am b/plugins/sbus/Makefile.am index 783b23c2ba..f10fba9414 100644 --- a/plugins/sbus/Makefile.am +++ b/plugins/sbus/Makefile.am @@ -25,6 +25,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = sbus.la diff --git a/plugins/stats_tree/Makefile.am b/plugins/stats_tree/Makefile.am index ee663f4600..84d1d72e4a 100644 --- a/plugins/stats_tree/Makefile.am +++ b/plugins/stats_tree/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = stats_tree.la diff --git a/plugins/tpg/Makefile.am b/plugins/tpg/Makefile.am index 850e1be749..be672ecb6a 100644 --- a/plugins/tpg/Makefile.am +++ b/plugins/tpg/Makefile.am @@ -22,6 +22,10 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # +if USING_GCC +AM_CFLAGS = -Werror +endif + INCLUDES = -I$(top_srcdir) plugindir = @plugindir@ diff --git a/plugins/v5ua/Makefile.am b/plugins/v5ua/Makefile.am index 253a6b8196..2f551e6692 100644 --- a/plugins/v5ua/Makefile.am +++ b/plugins/v5ua/Makefile.am @@ -26,6 +26,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir) include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + plugindir = @plugindir@ plugin_LTLIBRARIES = v5ua.la diff --git a/wiretap/Makefile.am b/wiretap/Makefile.am index 5f451ff654..f68b6f4470 100644 --- a/wiretap/Makefile.am +++ b/wiretap/Makefile.am @@ -25,6 +25,10 @@ ACLOCAL_AMFLAGS = `../aclocal-flags` include Makefile.common +if USING_GCC +AM_CFLAGS = -Werror +endif + lib_LTLIBRARIES = libwiretap.la libwiretap_la_LDFLAGS = -version-info 0:1:0 @LDFLAGS_SHAREDLIB@ diff --git a/wiretap/configure.in b/wiretap/configure.in index 724ab2f2ef..09abc98989 100644 --- a/wiretap/configure.in +++ b/wiretap/configure.in @@ -40,7 +40,7 @@ AC_ARG_WITH(extra-gcc-checks, wireshark_extra_gcc_flags=" -Wcast-qual -Wcast-align -Wbad-function-cast -pedantic -Wmissing-declarations -Wwrite-strings" fi ],) -AC_MSG_CHECKING(to see if we can add '-Wall -W -Wcast-qual $wireshark_extra_gcc_flags' to CFLAGS) +AC_MSG_CHECKING(to see if we can add '-Wall -W -Wcast-qual -Werror $wireshark_extra_gcc_flags' to CFLAGS) if test x$GCC != x ; then CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W $wireshark_extra_gcc_flags $CFLAGS" AC_MSG_RESULT(yes) @@ -49,6 +49,9 @@ else AC_MSG_RESULT(no) fi +# Create the USING_GCC variable for use in Makefile.am files +AM_CONDITIONAL(USING_GCC, test "x$GCC" != "x") + # # Add any platform-specific compiler flags needed. # |