syntax-check: fix violations and re-enable sc_cast_of_argument_to_free.

* cfg.mk (local-checks-to-fix): Remove
sc_cast_of_argument_to_free from list of disabled checks.
* build-aux/ltmain.m4sh, libltdl/libltdl/lt__alloc.h,
libltdl/lt__dirent.c: Casting argument to free is never
necessary.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
This commit is contained in:
Gary V. Vaughan 2011-10-26 15:11:45 +07:00
parent abc2b152d3
commit f3e71d08e8
5 changed files with 5 additions and 7 deletions

View File

@ -3517,7 +3517,7 @@ int setenv (const char *, const char *, int);
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
#define XFREE(stale) do { \
if (stale) { free ((void *) stale); stale = 0; } \
if (stale) { free (stale); stale = 0; } \
} while (0)
#if defined(LT_DEBUGWRAPPER)

4
cfg.mk
View File

@ -63,7 +63,6 @@ local-checks-to-skip = \
$(local-checks-to-fix) \
sc_GPL_version \
sc_bindtextdomain \
sc_cast_of_argument_to_free \
sc_cast_of_x_alloc_return_value \
sc_error_message_uppercase \
sc_program_name \
@ -71,8 +70,7 @@ local-checks-to-skip = \
# GPL_version: checks for GPLv3, which we don't use
# bindtextdomain: libtool isn't internationalized
# cast_of_argument_to_free: we don't use gnulib alloc modules
# cast_of_x_alloc_return_value: ditto
# cast_of_x_alloc_return_value: we don't use gnulib alloc modules
# error_message_uppercase: we like our error messages
# program_name: libtool has no programs!
# unmarked_diagnostics: libtool isn't internationalized

View File

@ -38,7 +38,7 @@ LT_BEGIN_C_DECLS
#define MALLOC(tp, n) (tp*) lt__malloc((n) * sizeof(tp))
#define REALLOC(tp, mem, n) (tp*) lt__realloc((mem), (n) * sizeof(tp))
#define FREE(mem) LT_STMT_START { \
free ((void *)mem); mem = NULL; } LT_STMT_END
free (mem); mem = NULL; } LT_STMT_END
#define MEMREASSIGN(p, q) LT_STMT_START { \
if ((p) != (q)) { free (p); (p) = (q); (q) = 0; } \
} LT_STMT_END

View File

@ -42,7 +42,7 @@ closedir (DIR *entry)
{
assert (entry != (DIR *) NULL);
FindClose (entry->hSearch);
free ((void *) entry);
free (entry);
}

View File

@ -2281,7 +2281,7 @@ lt_dlisresident (lt_dlhandle handle)
/* --- MODULE INFORMATION --- */
typedef struct {
const char *id_string;
char *id_string;
lt_dlhandle_interface *iface;
} lt__interface_id;