Opened 4 years ago

Closed 21 months ago

#62631 closed defect (fixed)

fuzz @0.6_1: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]

Reported by: c-kloukinas Owned by: barracuda156
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: catalina bigsur monterey ventura Cc: cooljeanius (Eric Gallager)
Port: fuzz

Description

Code is rejected by the compiler because it declares functions (e.g., strcmp) implicitly.

Maybe a missing include (maybe one that used to be auto-included but is no longer so)?

Having the same issue with these other ports btw - will raise separate tickets: grok mcrypt mmencode subversion-python27bindings tightvncport

Attachments (1)

main.log (18.1 KB) - added by c-kloukinas 4 years ago.
main installation log

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by c-kloukinas

Attachment: main.log added

main installation log

comment:1 Changed 3 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:2 Changed 3 years ago by cooljeanius (Eric Gallager)

I'm pretty sure this is in the same getopt.c file that has been patched in other ports; if so, it should be pretty easy to fix here, as well. Here's my output:

/usr/bin/clang -DPACKAGE=\"fuzz\" -DVERSION=\"0.6\" -DHAVE_LIBREADLINE=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_UNISTD_H=1 -DRETSIGTYPE=void -DHAVE_GETCWD=1 -DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_SNPRINTF=1  -I. -I.    -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c getopt.c
getopt.c:580:30: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
      if (optind != argc && !strcmp (argv[optind], "--"))
                             ^
getopt.c:580:30: note: include the header <string.h> or explicitly provide a declaration for 'strcmp'
getopt.c:656:7: error: implicitly declaring library function 'strncmp' with type 'int (const char *, const char *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
        if (!strncmp (p->name, nextchar, nameend - nextchar))
             ^
getopt.c:656:7: note: include the header <string.h> or explicitly provide a declaration for 'strncmp'
getopt.c:659:21: error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
                == (unsigned int) strlen (p->name))
                                  ^
getopt.c:659:21: note: include the header <string.h> or explicitly provide a declaration for 'strlen'
getopt.c:707:6: warning: add explicit braces to avoid dangling else [-Wdangling-else]
                   else
                   ^
1 warning and 3 errors generated.
make: *** [getopt.o] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fuzz/fuzz/work/fuzz-0.6'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fuzz/fuzz/work/fuzz-0.6" && /usr/bin/make -j16 -w all 
Exit code: 2
Error: Failed to build fuzz: command execution failed
DEBUG: Error code: CHILDSTATUS 54557 2

comment:3 Changed 21 months ago by barracuda156

On 10.6:

getopt.c: In function ‘_getopt_internal’:
getopt.c:659: warning: incompatible implicit declaration of built-in function ‘strlen’
getopt.c:683: warning: incompatible implicit declaration of built-in function ‘strlen’
getopt.c:713: warning: incompatible implicit declaration of built-in function ‘strlen’
getopt.c:729: warning: incompatible implicit declaration of built-in function ‘strlen’
getopt.c:734: warning: incompatible implicit declaration of built-in function ‘strlen’
getopt.c:845: warning: incompatible implicit declaration of built-in function ‘strlen’
getopt.c:868: warning: incompatible implicit declaration of built-in function ‘strlen’
getopt.c:888: warning: incompatible implicit declaration of built-in function ‘strlen’
getopt.c:902: warning: incompatible implicit declaration of built-in function ‘strlen’
getopt.c:906: warning: incompatible implicit declaration of built-in function ‘strlen’
fuzz.c: In function ‘main’:
fuzz.c:182: warning: format ‘%u’ expects type ‘unsigned int *’, but argument 3 has type ‘long unsigned int *’
fuzz.c:188: warning: format ‘%u’ expects type ‘unsigned int *’, but argument 3 has type ‘long unsigned int *’
fuzz.c:197: warning: format ‘%u’ expects type ‘unsigned int *’, but argument 3 has type ‘long unsigned int *’
fuzz.c:203: warning: format ‘%u’ expects type ‘unsigned int *’, but argument 3 has type ‘long unsigned int *’
fuzz.c:209: warning: format ‘%u’ expects type ‘unsigned int *’, but argument 3 has type ‘long unsigned int *’
fuzz.c:234: warning: format ‘%u’ expects type ‘unsigned int *’, but argument 3 has type ‘long unsigned int *’
fuzz.c:240: warning: format ‘%u’ expects type ‘unsigned int *’, but argument 3 has type ‘long unsigned int *’
fuzz.c:410: warning: format ‘%u’ expects type ‘unsigned int’, but argument 2 has type ‘long unsigned int’
fuzz.c: In function ‘print_arglist’:
fuzz.c:522: warning: format ‘%x’ expects type ‘unsigned int’, but argument 3 has type ‘char **’
fuzz.c:524: warning: format ‘%x’ expects type ‘unsigned int’, but argument 4 has type ‘char *’
fuzz.c:530: warning: '0' flag ignored with precision and ‘%x’ printf format

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

Keywords: catalina bigsur monterey ventura added; BigSur removed

comment:5 Changed 21 months ago by barracuda156

Owner: set to barracuda156
Resolution: fixed
Status: newclosed

In 5c31d0a5e83ffec307c71ac59656cf7a74e14a6b/macports-ports (master):

fuzz: fix build for newer macOS

Fixes: #62631

Note: See TracTickets for help on using tickets.