bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question about gettext.c line 792


From: Paul D. Smith
Subject: Re: question about gettext.c line 792
Date: Fri, 7 Sep 2001 17:59:51 -0400

%% Wendy Palm <address@hidden> writes:

  wp> ***************
  wp> *** 811,817 ****
  wp>                 && S_ISDIR (st.st_mode)))
  wp>           {
  wp>             pglob->gl_pathv
  wp> !             = (char **) realloc (pglob->gl_pathv,
  wp>                                    (pglob->gl_pathc +
  wp>                                     ((flags & GLOB_DOOFFS) ?
  wp>                                      pglob->gl_offs : 0) +
  wp> --- 812,818 ----
  wp>                 && S_ISDIR (st.st_mode)))
  wp>           {
  wp>             pglob->gl_pathv
  wp> !             = (char **) realloc (pglob->gl_pathv[0],
  wp>                                    (pglob->gl_pathc +
  wp>                                     ((flags & GLOB_DOOFFS) ?
  wp>                                      pglob->gl_offs : 0) +

All of these look wrong to me: you're changing the behavior of the code
by passing the indirection of the pointer instead of the pointer itself.

Either there is a bug in the original code (which I don't think there
is), or these changes are incorrect.

  wp> ***************
  wp> *** 742,748 ****
  wp>   
  wp>   
  wp>     end_p = argv[1];
  wp> !   while ((p = find_next_token (&end_p, 0)) != 0)
  wp>       if (--i == 0)
  wp>         break;
  wp>   
  wp> --- 742,748 ----
  wp>   
  wp>   
  wp>     end_p = argv[1];
  wp> !   while ((p = find_next_token (&end_p, (unsigned int *) 0)) != 0)
  wp>       if (--i == 0)
  wp>         break;
  
This should be unnecessary as well; given a proper prototype in scope
any compliant C compiler must automatically cast "0" to be a null
pointer of the proper type.

I'll check out the other changes, thanks...

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist



reply via email to

[Prev in Thread] Current Thread [Next in Thread]