Message-ID: <006101c2b636$00763030$0100a8c0@acp42g> From: "Andrew Cottrell" To: Cc: "Richard Dawe" Subject: Make realloc pointer problem [was part of Re: GCC 3.2.1 build failure] Date: Tue, 7 Jan 2003 21:17:06 +1100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_005E_01C2B692.21785590" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Reply-To: djgpp-workers AT delorie DOT com This is a multi-part message in MIME format. ------=_NextPart_000_005E_01C2B692.21785590 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Eli, I checked the past postings and this one slipped between the cracks. In = the last posting of the previous thread you asked for me to give more = details which I am now doing 7 months late..... The original posting with this issue was in the following thread: http://www.delorie.com/djgpp/mail-archives/browse.cgi?p=3Ddjgpp-workers/2= 002/05/29/06:33:31 > make.exe[2]: Entering directory `d:/dj204/gnu/make-3.80/glob' > gcc -I.. -I. -I. -I./glob -DHAVE_CONFIG_H -O2 -g -c fnmatch.c > gcc -I.. -I. -I. -I./glob -DHAVE_CONFIG_H -O2 -g -c glob.c > In file included from glob.c:813: > glob.c: In function `glob': > glob.c:197: warning: passing arg 0 of `my_realloc' from incompatible = pointer > type >=20 > Arg 0? This also occurs with make 3.79.2a1, which is where I first seen the = problem and it is also in 3.80.=20 Should I report this to the make maintainers or is it a DJGPP specific = problem or should I just ignore this warning? glob.c line 184: #ifndef __GNU_LIBRARY__ # ifdef __GNUC__ __inline # endif # ifndef __SASC # ifdef WINDOWS32 static void * # else static char * # endif my_realloc (p, n) char *p; unsigned int n; { /* These casts are the for sake of the broken Ultrix compiler, which warns of illegal pointer combinations otherwise. */ if (p =3D=3D NULL) return (char *) malloc (n); return (char *) realloc (p, n); } # define realloc my_realloc # endif /* __SASC */ #endif /* __GNU_LIBRARY__ */ glob.c line 813:- pglob->gl_pathv =3D (char **) realloc (pglob->gl_pathv, (pglob->gl_pathc + ((flags & GLOB_DOOFFS) ? glob.h :- typedef struct { __size_t gl_pathc; /* Count of paths matched by the pattern. = */ char **gl_pathv; /* List of matched pathnames. */ =20 ------=_NextPart_000_005E_01C2B692.21785590 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Eli,
 
I checked the past postings and this = one slipped=20 between the cracks. In the last posting of the previous thread you asked = for me=20 to give more details which I am now doing 7 months = late.....
 
The original posting with this issue = was in the=20 following thread:
http://www.delorie.com/djgpp/mail-archives/br= owse.cgi?p=3Ddjgpp-workers/2002/05/29/06:33:31
 
>=20 make.exe[2]: Entering directory `d:/dj204/gnu/make-3.80/glob'
> = gcc -I..=20 -I. -I. -I./glob -DHAVE_CONFIG_H -O2 -g -c fnmatch.c
> gcc -I.. = -I. -I.=20 -I./glob -DHAVE_CONFIG_H -O2 -g -c glob.c
> In file included from=20 glob.c:813:
> glob.c: In function `glob':
> glob.c:197: = warning:=20 passing arg 0 of `my_realloc' from incompatible pointer
> = type
>=20
> Arg 0?
This also occurs with make 3.79.2a1, which is where I first seen = the=20 problem and it is also in 3.80.
 
Should I report this to the make maintainers or is it a DJGPP = specific=20 problem or should I just ignore this warning?
 
glob.c  line 184:
#ifndef __GNU_LIBRARY__
# = ifdef __GNUC__
__inline
#=20 endif
# ifndef __SASC
#  ifdef WINDOWS32
static void = *
# =20 else
static char *
# endif
my_realloc (p,=20 n)
     char *p;
     = unsigned int=20 n;
{
  /* These casts are the for sake of the broken Ultrix=20 compiler,
     which warns of illegal pointer=20 combinations otherwise.  */
  if (p =3D=3D = NULL)
   =20 return (char *) malloc (n);
  return (char *) realloc (p, = n);
}
#=20 define realloc my_realloc
# endif /* __SASC */
#endif /* = __GNU_LIBRARY__ */
glob.c line 813:-
       = pglob->gl_pathv
   =20      =3D (char **) realloc=20 (pglob->gl_pathv,
       =20 (pglob->gl_pathc +
    =      =20 ((flags & GLOB_DOOFFS) ?
glob.h :-
    typedef = struct
     =20 {
        __size_t = gl_pathc;  /*=20 Count of paths matched by the pattern.  */
   =20     char **gl_pathv;  /* List of matched=20 pathnames.  */
 
------=_NextPart_000_005E_01C2B692.21785590--