[Bug 210938] devel/gmake: make-4.2.1/glob/glob.c could use 4 (char*) casts, one per example realloc that is currently given char** first arguments

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Jul 9 08:56:06 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210938

            Bug ID: 210938
           Summary: devel/gmake: make-4.2.1/glob/glob.c could use 4
                    (char*) casts, one per example realloc that is
                    currently given char** first arguments
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: tijl at FreeBSD.org
          Reporter: markmi at dsl-only.net
          Assignee: tijl at FreeBSD.org
             Flags: maintainer-feedback?(tijl at FreeBSD.org)

Just to get rid of misleading compiler warnings I recommend explicit (char*)
casts be added to avoid:

glob.c:818:27: warning: incompatible pointer types passing 'char **' to
parameter of type 'char *'; dereference with * [-Wincompatible-pointer-types]
            = (char **) realloc (pglob->gl_pathv,
                                 ^~~~~~~~~~~~~~~
                                 *
glob.c:937:24: warning: incompatible pointer types passing 'char **' to
parameter of type 'char *'; dereference with * [-Wincompatible-pointer-types]
                = (char **) realloc (pglob->gl_pathv,
                                     ^~~~~~~~~~~~~~~
                                     *
glob.c:992:39: warning: incompatible pointer types passing 'char **' to
parameter of type 'char *'; dereference with * [-Wincompatible-pointer-types]
              new_pathv = (char **) realloc (pglob->gl_pathv,
                                             ^~~~~~~~~~~~~~~
                                             *
glob.c:1383:23: warning: incompatible pointer types passing 'char **' to
parameter of type 'char *'; dereference with * [-Wincompatible-pointer-types]
        = (char **) realloc (pglob->gl_pathv,
                             ^~~~~~~~~~~~~~~
                             *


So, for example,

            = (char **) realloc ((char*) pglob->gl_pathv,

The compiler's suggested change is definitely wrong here and could be
confusing.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list