Opened 3 years ago

Closed 3 years ago

#62290 closed defect (fixed)

fastjar @0.94: error: implicitly declaring library function 'exit'

Reported by: cooljeanius (Eric Gallager) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: catalina bigsur Cc:
Port: fastjar

Description

Another victim of -Werror=implicit-function-declaration being on by default now:

make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_archivers_fastjar/fastjar/work/fastjar-0.94'
/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -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 jartool.c
/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -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 dostime.c
/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -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 compress.c
/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -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 pushback.c
/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -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 jargrep.c
compress.cjargrep.c:106:24:: error: 102:implicitly declaring library function 'malloc' with type 'void *(unsigned long)' [-Werror,-Wimplicit-function-declaration]
5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
    exit(1);
    ^
        if((exp = (regex_t *) malloc(sizeof(regex_t))))
                              ^
compress.c:102:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
jargrep.c:106:24: note: include the header <stdlib.h> or explicitly provide a declaration for 'malloc'
jargrep.c:113:5: error: implicit declaration of function 'free' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                                free(exp);
                                ^
jargrep.c:115:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
                                exit(1);
                                ^
jargrep.c:115:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
jargrep.c:120:5: error: implicit declaration of function 'free' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                                free(exp);
                                ^
compress.c:385:39: error: implicitly declaring library function 'malloc' with type 'void *(unsigned long)' [-Werror,-Wimplicit-function-declaration]
        if((zs.next_in = in_buff = (Bytef *) malloc(csize))) {
                                             ^
compress.c:385:39: note: include the header <stdlib.h> or explicitly provide a declaration for 'malloc'
compress.c:391:5: error: implicit declaration of function 'free' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                                free(in_buff);
                                ^
compress.c:398:5: error: implicit declaration of function 'free' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                                free(in_buff);
                                ^
compress.c:406:4: error: implicit declaration of function 'free' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                        free(in_buff);
                        ^
compress.c:447:24: error: implicitly declaring library function 'realloc' with type 'void *(void *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
                        if((tmp = (Bytef *) realloc(out_buff, (RDSZ * i) + 1))) {
                                            ^
compress.c:447:24: note: include the header <stdlib.h> or explicitly provide a declaration for 'realloc'
                __builtin___strncpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                               ^~~~~~~~~~~
jartool.c:1339:19: warning: passing 'ub1 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        if(strlen(start) == 0)
                  ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/string.h:82:28: note: passing argument to parameter '__s' here
size_t   strlen(const char *__s);
                            ^
jartool.c:1347:19: warning: passing 'ub1 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        if(strlen(start) == 0)
                  ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/string.h:82:28: note: passing argument to parameter '__s' here
size_t   strlen(const char *__s);
                            ^
jartool.c:1350:9: error: implicit declaration of function 'free' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        free(tmp_buff);
        ^
jartool.c:1354:22: warning: passing 'ub1 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        f_fd = creat(filename, 00644);
                     ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h:558:27: note: passing argument to parameter here
int     creat(const char *, mode_t) __DARWIN_ALIAS_C(creat);
                          ^
jartool.c:1358:18: warning: passing 'ub1 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
          perror(filename);
                 ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:169:26: note: passing argument to parameter here
void     perror(const char *) __cold;
                            ^
jartool.c:1572:15: error: implicit declaration of function 'free' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
              free(filename);
              ^
jartool.c:1588:33: warning: passing 'ub1 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            if(strcmp(files[j], filename) == 0){
                                ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/string.h:77:43: note: passing argument to parameter '__s2' here
int      strcmp(const char *__s1, const char *__s2);
                                              ^
jartool.c:1695:13: error: implicit declaration of function 'free' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            free(filename);
            ^
jartool.c:1737:33: warning: passing 'ub1 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            if(strcmp(files[j], filename) == 0){
                                ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/string.h:77:43: note: passing argument to parameter '__s2' here
int      strcmp(const char *__s1, const char *__s2);
                                              ^
14 warnings and 8 errors generated.
make: *** [jartool.o] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_archivers_fastjar/fastjar/work/fastjar-0.94'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_archivers_fastjar/fastjar/work/fastjar-0.94" && /usr/bin/make -j16 -w all 
Exit code: 2
Error: Failed to build fastjar: command execution failed
DEBUG: Error code: CHILDSTATUS 58409 2

Change History (2)

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

Keywords: catalina bigsur added

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

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 70967bfbe0570ca3ce5c385859d30ac1b5c1634b/macports-ports (master):

fastjar: Fix implicit declaration of functions

Closes: #62290

Also modernize checksums.

Note: See TracTickets for help on using tickets.