Opened 4 years ago

Closed 4 years ago

#61024 closed defect (fixed)

libgphoto2 @2.5.25: error: implicitly declaring library function 'strdup'

Reported by: GreyCon (Con Cunningham) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc:
Port: libgphoto2

Description

:debug:sysinfo macOS 10.15 (darwin/19.6.0) arch i386
:debug:sysinfo MacPorts 2.6.3
:debug:sysinfo Xcode 11.6
:debug:sysinfo SDK 10.15
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 10.7

:info:build gphoto2-port-info-list.c:253:38: error: implicitly declaring library function 'strdup' with type 'char *(const char *)' [-Werror,-Wimplicit-function-declaration]
:info:build                         list->info[j]->library_filename = strdup (filename);
:info:build                                                           ^
:info:build gphoto2-port-info-list.c:253:38: note: include the header <string.h> or explicitly provide a declaration for 'strdup'
:info:build 1 error generated.

Change History (4)

comment:1 Changed 4 years ago by mf2k (Frank Schima)

In the future, please add the port maintainer(s) to Cc (port info --maintainers libgphoto2), if any.

comment:2 Changed 4 years ago by mf2k (Frank Schima)

Owner: set to ryandesign
Status: newassigned

comment:3 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Status: assignedaccepted
Summary: libgphoto2_port 0.12.0: Compilation error : gphoto2-port-info-list.c:253:38libgphoto2 @2.5.25: error: implicitly declaring library function 'strdup'

Thanks for reporting this.

Are you using the Xcode 12 beta command line tools? That's the only explanation I can come up with for why implicit function declarations are being treated as errors in your case. In Xcode 11 and earlier they should be treated as warnings, and I recommend you use the Xcode 11.5 command line tools for now to avoid these types of problems.

I've reported this problem to the developers: https://github.com/gphoto/libgphoto2/issues/552

There are other problems after that that I'm still investigating.

comment:4 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 2c1fc1d3cfca6e0489a3e853c2f84f2211ab1e84/macports-ports (master):

libgphoto2: Fix implicit function declarations

Closes: #61024

Note: See TracTickets for help on using tickets.