[MacPorts] #61343: pgplot @5.2.2: error: implicit declaration of function (was: pgplot fails to build)

MacPorts noreply at macports.org
Sun Oct 18 23:40:10 UTC 2020


#61343: pgplot @5.2.2: error: implicit declaration of function
------------------------+-------------------------------
  Reporter:  aedolphin  |      Owner:  ryandesign
      Type:  defect     |     Status:  accepted
  Priority:  Normal     |  Milestone:
 Component:  ports      |    Version:  2.6.3
Resolution:             |   Keywords:  haspatch,catalina
      Port:  pgplot     |
------------------------+-------------------------------
Changes (by ryandesign):

 * cc: MarcusCalhoun-Lopez (added)
 * owner:  (none) => ryandesign
 * status:  new => accepted
 * milestone:  MacPorts 2.7.0 =>


Comment:

 Thanks for reporting this and finding the fix.

 It's the same type of problem we see with lots of old software when
 compiling with Xcode 12 or later:

 {{{
 sys/grfileio.c:82:5: error: implicitly declaring library function
 'strncpy' with type 'char *(char *, const char *, unsigned long)' [-Werror
 ,-Wimplicit-function-declaration]
     strncpy(buff, name, slen);
     ^
 sys/grfileio.c:82:5: note: include the header <string.h> or explicitly
 provide a declaration for 'strncpy'
 --
     strncpy(buff, name, slen);
     ^
 sys/grfileio.c:82:5: note: include the header <string.h> or explicitly
 provide a declaration for 'strncpy'
 sys/grfileio.c:129:12: error: implicit declaration of function 'close' is
 invalid in C99 [-Werror,-Wimplicit-function-declaration]
     return close(*fd);
            ^
 --
     return close(*fd);
            ^
 sys/grfileio.c:158:10: error: implicit declaration of function 'write' is
 invalid in C99 [-Werror,-Wimplicit-function-declaration]
   return write(*fd, (void *) buf, *nbytes);
          ^
 sys/grfileio.c:158:10: note: did you mean 'fwrite'?
 /usr/include/stdio.h:165:9: note: 'fwrite' declared here
 size_t   fwrite(const void * __restrict __ptr, size_t __size, size_t
 __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite);
          ^
 3 errors generated.
 }}}

 I'll get it fixed.

 Normally I would recommend sending the fix to the developers too but since
 the last release was in 2001 they probably aren't listening to bug reports
 anymore.

-- 
Ticket URL: <https://trac.macports.org/ticket/61343#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list