Opened 3 years ago

Closed 3 years ago

#61425 closed defect (fixed)

kermit @9.0.302: error: implicit declaration of function 'time' is invalid in C99

Reported by: Knapoc Owned by: Knapoc <Knapoc@…>
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: haspatch Cc: ericmoret
Port: kermit

Description

Kermit fails to build due to implicit declaration errors (see the attached main.log).

I tried to patch these errors but I failed miserably. The patch and the log file from building the patched version are attached too.

Attachments (3)

main.log (52.9 KB) - added by Knapoc 3 years ago.
Build log from unpatched kermit
main2.log (60.8 KB) - added by Knapoc 3 years ago.
Build log from patched kermit
implicit.patch (929 bytes) - added by Knapoc 3 years ago.
Attemted patch

Download all attachments as: .zip

Change History (11)

Changed 3 years ago by Knapoc

Attachment: main.log added

Build log from unpatched kermit

Changed 3 years ago by Knapoc

Attachment: main2.log added

Build log from patched kermit

Changed 3 years ago by Knapoc

Attachment: implicit.patch added

Attemted patch

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

Summary: kermit fails to compile on macOS 11.0 - implicit declarationkermit @9.0.302: error: implicit declaration of function 'time' is invalid in C99

Thanks for reporting the problem and trying to fix it.

For macOS 10.15 I would offer the workaround of downgrading to Xcode 11 and the Xcode 11 version of the command line tools, but since you're on macOS 11 beta you don't have that option.

It should be the developers of kermit who fix the problem. Unfortunately it looks like the last version of kermit was released in 2011, then the project moved to a new home where further development has taken place but no new official release has been made. There are testing releases there, and it may be that they have already fixed the problems in those testing releases. I haven't tried them yet, but for example the first error you saw was in ckcmai.c and in their latest testing version of the code ckcmai.c contains this post-2011 addition:

#ifdef TIMEH
/* This had to be added for NetBSD 6.1 - it might have "effects" elsewhere */
/* Tue Sep  3 17:03:42 2013 */
#include <time.h>
#endif /* TIMEH */

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

Unfortunately it looks like the latest 9.0.305-alpha02 does not fix the other implicit function declarations. I have reported the problem to the developers of kermit via their email address.

comment:3 in reply to:  2 Changed 3 years ago by Knapoc

Replying to ryandesign:

Unfortunately it looks like the latest 9.0.305-alpha02 does not fix the other implicit function declarations. I have reported the problem to the developers of kermit via their email address.

Thank you.

comment:4 Changed 3 years ago by ericmoret

Cc: ericmoret added

comment:5 Changed 3 years ago by pinxue (品雪)

Compiling issue is easy to patch:

ckupty.c and ckutio.c : 
#include <util.h>

ckuusx.c :
#include <curses.h>
#include <term.h>

ckcmai.c :
#include <time.h>

And then make -j8 macosx && make install just works, but port install failed weirdly:

/usr/bin/clang -arch x86_64  -o wermit \
		ckcmai.o ckclib.o ckutio.o ckufio.o \
		ckcfns.o ckcfn2.o ckcfn3.o ckuxla.o \
		ckcpro.o ckucmd.o ckuus2.o ckuus3.o \
		ckuus4.o ckuus5.o ckuus6.o ckuus7.o \
		ckuusx.o ckuusy.o ckuusr.o ckucns.o \
		ckudia.o ckuscr.o ckcnet.o ckusig.o \
		ckctel.o ckcuni.o ckupty.o ckcftp.o \
		ckuath.o ck_crp.o ck_ssl.o -lncurses -lresolv

ld: can't write output file: wermit for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [xermit] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_comms_kermit/kermit/work/cku302'

After port install failure, I run the linking command exactly same in source build dir and it still work, faint!

PS, running with Xcode 12 on macOS Big Sur v11.0.1, other 471 ports restored just fine.

comment:6 Changed 3 years ago by pinxue (品雪)

OK, clean up kermit and

port -vs install kermit +x86_64

did the trick. Now I got minicom back.

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

Keywords: haspatch added

The kermit port doesn't have an +x86_64 variant. (You can see by running port variants kermit.) No ports do. That's not a variant name we would use: we don't use variants to select architectures.

A pull request has been submitted: https://github.com/macports/macports-ports/pull/9311

comment:8 Changed 3 years ago by Knapoc <Knapoc@…>

Owner: set to Knapoc <Knapoc@…>
Resolution: fixed
Status: newclosed

In 6e56cb715325e487a6d5554ab3ea1e1feb4361fa/macports-ports (master):

kermit: patch implicit declaration errors

Closes: #61425

Note: See TracTickets for help on using tickets.