diff options
author | Gary V. Vaughan <gary@gnu.org> | 2011-10-26 15:11:45 +0700 |
---|---|---|
committer | Gary V. Vaughan <gary@gnu.org> | 2011-11-17 19:11:12 +0700 |
commit | f3e71d08e878bdb7408d763f745b70bb34078af0 (patch) | |
tree | 3f7ca55d01c1353b41557b6b5181f0a7a68b5a47 | |
parent | abc2b152d3e8a7427123cd651d888a6b3a6e5fde (diff) | |
download | libtool-f3e71d08e878bdb7408d763f745b70bb34078af0.tar.gz |
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>
-rw-r--r-- | build-aux/ltmain.m4sh | 2 | ||||
-rw-r--r-- | cfg.mk | 4 | ||||
-rw-r--r-- | libltdl/libltdl/lt__alloc.h | 2 | ||||
-rw-r--r-- | libltdl/lt__dirent.c | 2 | ||||
-rw-r--r-- | libltdl/ltdl.c | 2 |
5 files changed, 5 insertions, 7 deletions
diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh index 5501a4db..ff3a52f8 100644 --- a/build-aux/ltmain.m4sh +++ b/build-aux/ltmain.m4sh @@ -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) @@ -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 diff --git a/libltdl/libltdl/lt__alloc.h b/libltdl/libltdl/lt__alloc.h index 45f7b523..a1d7b377 100644 --- a/libltdl/libltdl/lt__alloc.h +++ b/libltdl/libltdl/lt__alloc.h @@ -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 diff --git a/libltdl/lt__dirent.c b/libltdl/lt__dirent.c index 30dc072c..1ff20511 100644 --- a/libltdl/lt__dirent.c +++ b/libltdl/lt__dirent.c @@ -42,7 +42,7 @@ closedir (DIR *entry) { assert (entry != (DIR *) NULL); FindClose (entry->hSearch); - free ((void *) entry); + free (entry); } diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 01853e05..85f84521 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -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; |