Opened 3 years ago

Closed 3 years ago

#61670 closed defect (fixed)

netpipes: error: implicitly declaring library function 'strcmp'

Reported by: alex1platon Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: bigsur catalina Cc:
Port: netpipes

Description

Using stock Command Line Tools for XCode 12.2

:info:build cc -DUSE_IOCTL -DPOSIX_SIG -DHAVE_INET_ATON -O   -c -o encapsulate.o encapsulate.c
:info:build timelimit.c:98:9: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
:info:build         if (0==strcmp(argv[1], "-v")) {
:info:build                ^
:info:build timelimit.c:98:9: note: include the header <string.h> or explicitly provide a declaration for 'strcmp'
:info:build timelimit.c:119:12: error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
:info:build         ch = ch + strlen(ch)-1;
:info:build                   ^
:info:build timelimit.c:119:12: note: include the header <string.h> or explicitly provide a declaration for 'strlen'
:info:build timelimit.c:152:58: error: implicitly declaring library function 'strerror' with type 'char *(int)' [-Werror,-Wimplicit-function-declaration]
:info:build         fprintf(stderr, "%s: unable to fork (%s).\n", progname, strerror(errno));
:info:build                                                                 ^
:info:build timelimit.c:152:58: note: include the header <string.h> or explicitly provide a declaration for 'strerror'
:info:build 3 errors generated.
:info:build make: *** [timelimit.o] Error 1

Attachments (1)

main.log (18.1 KB) - added by alex1platon 3 years ago.
main.log

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by alex1platon

Attachment: main.log added

main.log

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

Keywords: bigsur catalina added; netpipes Big Sur Big_Sur removed
Summary: netpipes fails to build in Big Surnetpipes: error: implicitly declaring library function 'strcmp'

The well-known Xcode 12 problem.

comment:2 Changed 3 years ago by pessaux-f (François Pessaux)

The same occurs for enscript. I do not open a duplicate ticket I guess.

:info:build make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_print_enscript/enscript/work/enscript-1.6.6/compat'
:info:build /usr/bin/clang -DHAVE_CONFIG_H -I. -I.. -I./../intl -I../intl  -I/opt/local/include -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk  -pipe -Os -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -arch x86_64 -c getopt.c
:info:build getopt.c:527:30: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
:info:build       if (optind != argc && !strcmp (argv[optind], "--"))
:info:build                              ^
:info:build getopt.c:527:30: note: include the header <string.h> or explicitly provide a declaration for 'strcmp'
:info:build getopt.c:603:7: error: implicitly declaring library function 'strncmp' with type 'int (const char *, const char *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
:info:build         if (!strncmp (p->name, nextchar, nameend - nextchar))
:info:build              ^
:info:build getopt.c:603:7: note: include the header <string.h> or explicitly provide a declaration for 'strncmp'
:info:build getopt.c:606:21: error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
:info:build                 == (unsigned int) strlen (p->name))
:info:build                                   ^
:info:build getopt.c:606:21: note: include the header <string.h> or explicitly provide a declaration for 'strlen'

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

Each port needs an individual fix, so please open a ticket for each affected port. The enscript ticket is #61730.

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

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In ca5e9b42d47dcf9ecbea5da0a1a2efc4d96b7027/macports-ports (master):

netpipes: Fix flags, universal, implicit functions

Use the right compiler and MacPorts flags and add universal variant.

Fix implicit declaration of string functions.

Closes: #61670

And modernize checksums.

Note: See TracTickets for help on using tickets.