[MacPorts] #71270: xar @1.8.0.501_0: error: call to undeclared library function 'free' with type 'void (void *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

MacPorts noreply at macports.org
Sun Nov 10 06:53:05 UTC 2024


#71270: xar @1.8.0.501_0: error: call to undeclared library function 'free' with
type 'void (void *)'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
----------------------+-------------------------
  Reporter:  djmagma  |      Owner:  Schamschula
      Type:  defect   |     Status:  assigned
  Priority:  Normal   |  Milestone:
 Component:  ports    |    Version:  2.10.4
Resolution:           |   Keywords:  haspatch
      Port:  xar      |
----------------------+-------------------------
Changes (by ryandesign):

 * keywords:  sequoia => haspatch


Comment:

 Replying to [ticket:71270 djmagma]:

 > {{{
 > :info:build lib/ext2.c:116:2: error: call to undeclared library function
 'free' with type 'void (void *)'; ISO C99 and later do not support
 implicit function declarations [-Wimplicit-function-declaration]
 > :info:build   116 |         free(vstr);
 > :info:build       |         ^
 > :info:build lib/ext2.c:116:2: note: include the header <stdlib.h> or
 explicitly provide a declaration for 'free'
 > :info:build lib/ext2.c:194:13: error: call to undeclared library
 function 'strtol' with type 'long (const char *, char **, int)'; ISO C99
 and later do not support implicit function declarations [-Wimplicit-
 function-declaration]
 > :info:build   194 |                 version = strtol(temp, NULL, 10);
 > :info:build       |                           ^
 > :info:build lib/ext2.c:194:13: note: include the header <stdlib.h> or
 explicitly provide a declaration for 'strtol'
 > :info:build 2 errors generated.
 > }}}

 These are indeed errors in the code that the developer of the code (Apple)
 should fix in the indicated way. Somebody should report the bug to them.
 However, this code is only compiled if e2fsprogs is found, which it is on
 your system:

 > {{{
 > :info:configure checking for ext2fs/ext2_fs.h... yes
 > }}}

 I can reproduce this on macOS 12 when e2fsprogs is installed and I do not
 use trace mode.

 e2fsprogs is not declared as a dependency of the xar port so it was
 probably not intended that it be used. So our solution will probably not
 be to fix this error in the code, but rather to ensure that e2fsprogs is
 not used even if it is installed: https://github.com/macports/macports-
 ports/pull/26532

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


More information about the macports-tickets mailing list