Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Jul 2016 08:56:05 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [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
Message-ID:  <bug-210938-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210938

            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@FreeBSD.org
          Reporter: markmi@dsl-only.net
          Assignee: tijl@FreeBSD.org
             Flags: maintainer-feedback?(tijl@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-type=
s]
            =3D (char **) realloc (pglob->gl_pathv,
                                 ^~~~~~~~~~~~~~~
                                 *
glob.c:937:24: warning: incompatible pointer types passing 'char **' to
parameter of type 'char *'; dereference with * [-Wincompatible-pointer-type=
s]
                =3D (char **) realloc (pglob->gl_pathv,
                                     ^~~~~~~~~~~~~~~
                                     *
glob.c:992:39: warning: incompatible pointer types passing 'char **' to
parameter of type 'char *'; dereference with * [-Wincompatible-pointer-type=
s]
              new_pathv =3D (char **) realloc (pglob->gl_pathv,
                                             ^~~~~~~~~~~~~~~
                                             *
glob.c:1383:23: warning: incompatible pointer types passing 'char **' to
parameter of type 'char *'; dereference with * [-Wincompatible-pointer-type=
s]
        =3D (char **) realloc (pglob->gl_pathv,
                             ^~~~~~~~~~~~~~~
                             *


So, for example,

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

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

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-210938-13>