Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#62247 closed defect (fixed)

anacron @2.3_3: error: implicitly declaring library function 'abort'

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

Description

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

make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_anacron/anacron/work/anacron-2.3'
cc -c -DSPOOLDIR=\"/opt/local/var/spool/anacron\" -DRELEASE=\"2.3\" -DANACRONTAB=\"/opt/local/etc/anacrontab\"  -Wall -pedantic -O2 -I. log.c -o log.o
cc -c -DSPOOLDIR=\"/opt/local/var/spool/anacron\" -DRELEASE=\"2.3\" -DANACRONTAB=\"/opt/local/etc/anacrontab\"  -Wall -pedantic -O2 -I. main.c -o main.o
cc -c -DSPOOLDIR=\"/opt/local/var/spool/anacron\" -DRELEASE=\"2.3\" -DANACRONTAB=\"/opt/local/etc/anacrontab\"  -Wall -pedantic -O2 -I. matchrx.c -o matchrx.o
cc -c -DSPOOLDIR=\"/opt/local/var/spool/anacron\" -DRELEASE=\"2.3\" -DANACRONTAB=\"/opt/local/etc/anacrontab\"  -Wall -pedantic -O2 -I. obstack.c -o obstack.o
obstack.c:406:5: error: implicitly declaring library function 'abort' with type 'void (void) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
    abort ();
    ^
obstack.c:406:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'abort'
obstack.c:486:3: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
  exit (obstack_exit_failure);
  ^
obstack.c:486:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
2 errors generated.
make: *** [obstack.o] Error 1
make: *** Waiting for unfinished jobs....
matchrx.c:50:2: error: implicitly declaring library function 'memset' with type 'void *(void *, int, unsigned long)' [-Werror,-Wimplicit-function-declaration]
        memset(sub_offsets, 0, sizeof(regmatch_t) * (n_sub + 1));
        ^
matchrx.c:50:2: note: include the header <string.h> or explicitly provide a declaration for 'memset'
1 error generated.
main.c:125:6: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
            exit(0);
            ^
main.c:125:6: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
log.c:174:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
    exit(FAILURE_EXIT);
    ^
log.c:174:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
1 error generated.
1 error generated.
make: *** [matchrx.o] Error 1
make: *** [log.o] Error 1
make: *** [main.o] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_anacron/anacron/work/anacron-2.3'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_anacron/anacron/work/anacron-2.3" && /usr/bin/make -j16 -w all PREFIX=/opt/local 
Exit code: 2
Error: Failed to build anacron: command execution failed
DEBUG: Error code: CHILDSTATUS 61653 2

Change History (6)

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

Keywords: bigsur catalina added
Summary: anacron @2.3_3 fails to buildanacron @2.3_3: error: implicitly declaring library function 'abort'

This is the well-known implicit declaration of function issue with Xcode 12 and later that needs to be fixed in the usual way (include the right headers in the right places).

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

Owner: set to ryandesign
Status: newaccepted

Almost done fixing this and modernizing the rest of the port, except that #62292 is causing trouble.

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

Replying to ryandesign:

Almost done fixing this and modernizing the rest of the port, except that #62292 is causing trouble.

#62292 is closed now

comment:4 Changed 3 years ago by pdvnl

Cc: pdvnl added

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

Resolution: fixed
Status: acceptedclosed

In db23a98e5ab6fed765dda5bc9bd7b646a619ccc6/macports-ports (master):

anacron: Fix implicit declaration of functions

Closes: #62247

Also modernize checksums, rename patchfiles, and reorganize portfile
slightly.

comment:6 Changed 3 years ago by pdvnl

works for me.

thanks!

Note: See TracTickets for help on using tickets.