Add -Werror when using GCC only to the Makefile.am of the base
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 22 Mar 2007 23:03:39 +0000 (23:03 +0000)
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 22 Mar 2007 23:03:39 +0000 (23:03 +0000)
directory and most of the plugins to match the same command
put in the Makefile.nmake files for Windows compliations.  Fix
a few warnings when compiling under gcc 3.4.4 on FreeBSD.  Create
new automake file variable called USING_GCC in configure.in and
wiretap/configure.in to acomplish the above -Werror addition.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21127 f5534014-38df-0310-8fa8-9805f1628bb7

33 files changed:
Makefile.am
capture_sync.c
codecs/Makefile.am
configure.in
file.c
plugins/agentx/Makefile.am
plugins/artnet/Makefile.am
plugins/asn1/Makefile.am
plugins/ciscosm/Makefile.am
plugins/docsis/Makefile.am
plugins/enttec/Makefile.am
plugins/gryphon/Makefile.am
plugins/h223/Makefile.am
plugins/h223/packet-h223.c
plugins/irda/Makefile.am
plugins/lwres/Makefile.am
plugins/megaco/Makefile.am
plugins/megaco/packet-megaco.c
plugins/mgcp/Makefile.am
plugins/opsi/Makefile.am
plugins/pcli/Makefile.am
plugins/profinet/Makefile.am
plugins/profinet/packet-dcerpc-pn-io.c
plugins/profinet/packet-dcom-cba-acco.c
plugins/rlm/Makefile.am
plugins/rtnet/Makefile.am
plugins/rudp/Makefile.am
plugins/sbus/Makefile.am
plugins/stats_tree/Makefile.am
plugins/tpg/Makefile.am
plugins/v5ua/Makefile.am
wiretap/Makefile.am
wiretap/configure.in

index 19ecbbcd9699d33f4d50105d497450895c60af15..c742ab001942f3816efb84944a820cd7b0208b5a 100644 (file)
@@ -25,6 +25,10 @@ ACLOCAL_AMFLAGS = `./aclocal-flags`
 
 INCLUDES= @LUA_INCLUDES@
 
+if USING_GCC
+AM_CFLAGS = -Werror
+endif
+
 #
 # This is a hideous hack.
 #
index 4d2120c58dbc550339e60e2448b73202311e865b..4b67d0cd58759cd38ca017bcaea377a35b6ae192 100644 (file)
@@ -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, "");
index 6eb1a4c0567c43265118c9bf95ea9ebdf9274224..a68fd61a63be8f9347b6bde7e3a5ec45858c11cf 100644 (file)
@@ -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
 
index 4b0a700b81661764022bcacb78a996f6d379fb5a..e9602ad59315894fb6f831eb1b46b59c7528c8fe 100644 (file)
@@ -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.
 #
diff --git a/file.c b/file.c
index a3de5552d0dbefa828b5bfc44ab13a1100a614c1..00392748675082c768d25bb298e4201260ee1de5 100644 (file)
--- a/file.c
+++ b/file.c
@@ -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.
index b0825e6f6635a0de4ce08405f1108635bdec0002..b1cb3737d9bf8226e2707573bbddcfb99a959053 100644 (file)
@@ -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
index 50a79d716a637b797ce519e89752db57a4b05017..e0d3ff7d1c23880d8db77361da57992a69643cb9 100644 (file)
@@ -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
index 7f84697be609eaa2a96b1a5c88d067f48b270040..e63a5700965126af4ad129a1258c49f4a2e5147e 100644 (file)
@@ -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
index 8faf3ce6acb88b60304c14384de548c1821e4b26..a915b4bbe040ec490adaeaa4d3dfeba72041c06d 100644 (file)
@@ -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
index a788f053c48249605986191b620d05a20c31c4ee..10816545c03a83db7651c8097aa79c1b0de9dc15 100644 (file)
@@ -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
index a20d4127ae446cdbb50c5f627b5542d0e412208b..8f0fa033151c397201669600a1c8857c1598b916 100644 (file)
@@ -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
index 9698546133ca7ed6a9bd0c1762b99128c57cea6f..bd8fba3b6f4ad5e0ed2dc9d4a87e8b7c614999c5 100644 (file)
@@ -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
index 1b5120e371b2c60a06818060b5037727107e8eb1..c965b25742c7d9a804d3da01ea2ae7d981ebf635 100644 (file)
@@ -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
index 1543dfd1d7ba4b5e775380c96546db4bfb2288f3..4a20a7b1d02e08ccd38ff7d061c7a6c094d7a6cf 100644 (file)
@@ -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);
         }
     }
 
index a3229a8efc2db39b74c5f329b7fed9db656d91ad..47efd1cc48dd3cff244aa16153a0874039e9041f 100644 (file)
@@ -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
index d05ff7464dcd6e09a6a5fc2f31259b60cc0a8a38..b23636f5a6a2d0dba902bacb3f706fd4b9cc0f5a 100644 (file)
@@ -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
index 91f2495ef0562c5fdafaf125b69bef56c779965e..344f7c06a10ce5629a4f529017c72d9e8baca5e9 100644 (file)
@@ -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
index d5b2d270be7c7ee27f155330de379808481e2ef1..6d57b285cab9752bb7574786c4a78f18a8adb3e3 100644 (file)
@@ -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
index 90352a237596ff4d60271bacafda5442e0f4562e..02e8593f9f936005173bda54d58fcda433b74595 100644 (file)
@@ -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
index 2026fe47a042702b064679e4326a3626d4810be5..37fa0e3fafff0a04470d099608f72ed2605375a9 100644 (file)
@@ -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
index 77ed754b08cd54d28912582b9853347f958e3736..368b8f7e29232e4dc587295e4c48af9fa7c2ab06 100644 (file)
@@ -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
index 4212fce1d21200d4d1655032547ec97e21864a33..219f3850db93a847ffedcc26daed481b34fe424f 100644 (file)
@@ -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
index c652e6b7d6d80377832797d08ab1f3c8ba3ed19e..777728a7d0214e833874be82b696e1a7cb76b39f 100644 (file)
@@ -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)";
     }
 
index 883be61778d19d2bd8bdfacccb7a9511749042b7..b7b004c96fe92c2851933af25d5fa9066b1b90b9 100644 (file)
@@ -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)
 {
index bb12359e020e912392d3326f53fae6e43d6b8cae..8a6d01632e939155dc438483354ff55a5dc651dd 100644 (file)
@@ -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
index 86d4d33110d5b4cc892df9e9669db15ddd02e088..4ec2a58de59d2a5db01f20a969793d7503ed8e8a 100644 (file)
@@ -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
index 13fda2b00ea20897e402d2ed6efcac2e1eecd0ee..6c07e7f5387c388fd81f3f21b6db6f0e5def55d0 100644 (file)
@@ -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
index 783b23c2ba74fe32dc86342ce6aeee8eb6f10709..f10fba9414da73476d944ed10e88693dc95b19f7 100644 (file)
@@ -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
index ee663f4600bd33508b8be91098c2331dc60ac5a0..84d1d72e4a871ff7ba998dfe707b2bc76913eb05 100644 (file)
@@ -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
index 850e1be749fe5804a077bc3d7b1338b756bdf36d..be672ecb6a4aec5518d7d4e868fbb9edd8dd7c8c 100644 (file)
 # 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@
index 253a6b8196db9d556f6c8b5e472455a73e193e6a..2f551e6692939a97a7442470af0d068253fa766a 100644 (file)
@@ -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
index 5f451ff654c2fc1f75732cd2a8cf2dc525ce82c2..f68b6f4470e646f1b75b745c829419e01e1aae87 100644 (file)
@@ -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@
 
index 724ab2f2ef37f836f9f851ab454edf503faa7482..09abc989894cb20c2f8dc73b330945ab77dbf7ca 100644 (file)
@@ -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.
 #