From Joerg Mayer: get rid of "-Wno-unused" flag in some configure

scripts, and check in changes to add _U_ to some unused arguments (some
other should perhaps be used, so we leave the _U_ out so that the
warnings serve as a reminder to check those).

svn path=/trunk/; revision=4848
This commit is contained in:
Guy Harris 2002-03-02 20:51:46 +00:00
parent 761ae95b19
commit 52fb615708
11 changed files with 35 additions and 29 deletions

View File

@ -87,6 +87,7 @@ Joerg Mayer <jmayer[AT]loplof.de> {
In configure scripts, if the compiler is GCC, add to CFLAGS a -D
flag to define _U_ as something that marks an argument
unused in GCC, and as nothing for other compilers
Add _U_ to unused arguments, and turn off "-Wno-unused"
}
Martin Maciaszek <fastjack[AT]i-s-o.net> {

View File

@ -1,4 +1,4 @@
# $Id: configure.in,v 1.20 2002/02/27 09:42:39 guy Exp $
# $Id: configure.in,v 1.21 2002/03/02 20:48:10 guy Exp $
dnl
dnl Process this file with autoconf 2.13 or later to produce a
dnl configure script; 2.12 doesn't generate a "configure" script that
@ -30,16 +30,16 @@ AC_PATH_PROG(LEX, flex)
AC_SUBST(FLEX_PATH)
#
# If we're running gcc, add '-Wall -W -Wno-unused' to CFLAGS, and add
# '-D_U_="__attribute__((unused))"' as well, for future use when we
# remove '-Wno-unused'.
# If we're running gcc, add '-Wall -W' to CFLAGS, and add
# '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
# flag unused function arguments and not get warnings about them.
#
# Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
# argument will compile with non-GCC compilers.
#
AC_MSG_CHECKING(to see if we can add '-Wall -W -Wno-unused' to CFLAGS)
AC_MSG_CHECKING(to see if we can add '-Wall -W' to CFLAGS)
if test x$GCC != x ; then
CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W -Wno-unused $CFLAGS"
CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W $CFLAGS"
AC_MSG_RESULT(yes)
else
CFLAGS="-D_U_=\"\" $CFLAGS"

View File

@ -1,7 +1,7 @@
/* drange.c
* Routines for providing general range support to the dfilter library
*
* $Id: drange.c,v 1.2 2001/03/02 17:04:23 gram Exp $
* $Id: drange.c,v 1.3 2002/03/02 20:48:11 guy Exp $
*
* Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu>
*
@ -138,7 +138,7 @@ drange_new_from_list(GSList *list)
static void
drange_node_free_wrapper(gpointer data, gpointer userdata)
drange_node_free_wrapper(gpointer data, gpointer userdata _U_)
{
g_free(data);
}

View File

@ -1,5 +1,5 @@
/*
* $Id: gencode.c,v 1.5 2002/01/21 07:37:37 guy Exp $
* $Id: gencode.c,v 1.6 2002/03/02 20:48:11 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -333,7 +333,7 @@ typedef struct {
} hash_key_iterator;
static void
get_hash_key(gpointer key, gpointer value, gpointer user_data)
get_hash_key(gpointer key, gpointer value _U_, gpointer user_data)
{
int field_id = GPOINTER_TO_INT(key);
hash_key_iterator *hki = user_data;

View File

@ -1,5 +1,5 @@
/*
* $Id: semcheck.c,v 1.9 2002/02/27 18:54:33 gram Exp $
* $Id: semcheck.c,v 1.10 2002/03/02 20:48:11 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -330,7 +330,7 @@ check_relation_LHS_FIELD(FtypeCanFunc can_func, stnode_t *st_node,
}
static void
check_relation_LHS_STRING(FtypeCanFunc can_func, stnode_t *st_node,
check_relation_LHS_STRING(FtypeCanFunc can_func _U_, stnode_t *st_node,
stnode_t *st_arg1, stnode_t *st_arg2)
{
stnode_t *new_st;
@ -384,7 +384,7 @@ check_relation_LHS_STRING(FtypeCanFunc can_func, stnode_t *st_node,
}
static void
check_relation_LHS_RANGE(FtypeCanFunc can_func, stnode_t *st_node,
check_relation_LHS_RANGE(FtypeCanFunc can_func _U_, stnode_t *st_node,
stnode_t *st_arg1, stnode_t *st_arg2)
{
stnode_t *new_st;
@ -492,7 +492,7 @@ check_test(stnode_t *st_node)
break;
case TEST_OP_NOT:
semcheck( st_arg1);
semcheck(st_arg1);
break;
case TEST_OP_AND:

View File

@ -1,7 +1,7 @@
/* filesystem.c
* Filesystem utility routines
*
* $Id: filesystem.c,v 1.16 2002/01/04 21:50:26 guy Exp $
* $Id: filesystem.c,v 1.17 2002/03/02 20:48:10 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -528,7 +528,11 @@ get_home_dir(void)
* from earlier versions can be read.
*/
char *
get_persconffile_path(const char *filename, gboolean for_writing)
get_persconffile_path(const char *filename, gboolean for_writing
#ifndef WIN32
_U_
#endif
)
{
char *path;
#ifdef WIN32

View File

@ -1,5 +1,5 @@
/*
* $Id: ftype-string.c,v 1.5 2002/02/05 22:50:17 guy Exp $
* $Id: ftype-string.c,v 1.6 2002/03/02 20:48:13 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -60,7 +60,7 @@ value_get(fvalue_t *fv)
}
static gboolean
val_from_string(fvalue_t *fv, char *s, LogFunc logfunc)
val_from_string(fvalue_t *fv, char *s, LogFunc logfunc _U_)
{
fv->value.string = g_strdup(s);
return TRUE;

View File

@ -2,7 +2,7 @@
* Routines for handling of 64-bit integers
* 2001 Ronnie Sahlberg
*
* $Id: int-64bit.c,v 1.1 2001/11/22 03:07:06 hagbard Exp $
* $Id: int-64bit.c,v 1.2 2002/03/02 20:48:10 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -264,7 +264,7 @@ revcmp(const signed char *s1, const signed char *s2, int len)
{
int i;
for(i=U64STRLEN-1;i>=0;i--){
for(i=len-1;i>=0;i--){
if(s1[i]==s2[i]){
continue;
}

View File

@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
* $Id: packet.c,v 1.65 2002/02/27 08:57:23 guy Exp $
* $Id: packet.c,v 1.66 2002/03/02 20:48:10 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -139,7 +139,7 @@ register_init_routine(void (*func)(void))
/* Initialize all data structures used for dissection. */
static void
call_init_routine(gpointer routine, gpointer dummy)
call_init_routine(gpointer routine, gpointer dummy _U_)
{
void (*func)(void) = routine;
@ -177,7 +177,7 @@ register_postseq_cleanup_routine(void (*func)(void))
/* Call all the registered "postseq_cleanup" routines. */
static void
call_postseq_cleanup_routine(gpointer routine, gpointer dummy)
call_postseq_cleanup_routine(gpointer routine, gpointer dummy _U_)
{
void (*func)(void) = routine;
@ -397,7 +397,8 @@ dissector_add(const char *name, guint32 pattern, dissector_handle_t handle)
/* If temporary dissectors are deleted, then the original dissector must */
/* be available. */
void
dissector_delete(const char *name, guint32 pattern, dissector_handle_t handle)
dissector_delete(const char *name, guint32 pattern,
dissector_handle_t handle _U_)
{
dissector_table_t sub_dissectors = find_dissector_table( name);
dtbl_entry_t *dtbl_entry;

View File

@ -1,7 +1,7 @@
/* proto.c
* Routines for protocol tree
*
* $Id: proto.c,v 1.55 2002/02/27 18:54:31 gram Exp $
* $Id: proto.c,v 1.56 2002/03/02 20:48:10 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -298,7 +298,7 @@ free_field_info(void *fi)
}
static void
free_GPtrArray_value(gpointer key, gpointer value, gpointer user_data)
free_GPtrArray_value(gpointer key _U_, gpointer value, gpointer user_data _U_)
{
GPtrArray *ptrs = value;
@ -330,7 +330,7 @@ free_node_field_info(field_info* finfo)
}
static gboolean
proto_tree_free_node(GNode *node, gpointer data)
proto_tree_free_node(GNode *node, gpointer data _U_)
{
field_info *finfo = PITEM_FINFO(node);

View File

@ -1,7 +1,7 @@
/* resolv.c
* Routines for network object lookup
*
* $Id: resolv.c,v 1.21 2002/01/30 08:46:29 guy Exp $
* $Id: resolv.c,v 1.22 2002/03/02 20:48:10 guy Exp $
*
* Laurent Deniel <deniel@worldnet.fr>
*
@ -252,7 +252,7 @@ static guchar *serv_name_lookup(guint port, port_type proto)
jmp_buf hostname_env;
static void abort_network_query(int sig)
static void abort_network_query(int sig _U_)
{
longjmp(hostname_env, 1);
}