[tin-dev] Error in compiling tin-2.6.2

Urs Janßen urs at tin.org
Thu Dec 29 09:02:04 CET 2022


Brad Littlejohn wrote:
>         Since tin-2.6.2 was in the beta/snapshot stage, I’ve been getting the following error when compiling it:
> 
> 
> bradl at MacBook-Air-3:~/tin-2.6.2/src> make
> gcc -DHAVE_CONFIG_H -I. -I../include -I../pcre -I../pcre  -DLOCALEDIR=\"/usr/local/share/locale\" -I../include   -D_DARWIN_C_SOURCE -D_CONST_X_STRING -O2 -Qunused-arguments -Wno-error=implicit-function-declaration  -W -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wdeclaration-after-statement -Wextra -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wno-inline -Wwrite-strings -c ./nntplib.c
> ./nntplib.c:526:10: warning: implicit declaration of function 's_close' is invalid in C99 [-Wimplicit-function-declaration]
>                 (void) s_close(s);
> 
> 1 warning generated.
> Linking tin v2.6.2 ...
> gcc  -o ./tin  ./active.o ./art.o ./attrib.o ./auth.o ./charset.o ./color.o ./config.o ./cook.o ./curses.o ./debug.o ./envarg.o ./feed.o ./filter.o ./getline.o ./global.o ./group.o ./hashstr.o ./header.o ./help.o ./inews.o ./init.o ./joinpath.o ./keymap.o ./lang.o ./langinfo.o ./list.o ./lock.o ./mail.o ./main.o ./memory.o ./mimetypes.o ./misc.o ./my_tmpfile.o ./newsrc.o ./nntplib.o ./nntps.o ./nrctbl.o ./options_menu.o ./page.o ./parsdate.o ./pgp.o ./plp_snprintf.o ./post.o ./prompt.o ./read.o ./refs.o ./regex.o ./rfc1524.o ./rfc2045.o ./rfc2046.o ./rfc2047.o ./save.o ./screen.o ./search.o ./select.o ./sigfile.o ./signal.o ./strftime.o ./string.o ./tags.o ./tcurses.o ./tmpfile.o ./thread.o ./version.o ./wildmat.o ./xref.o -L../pcre -lpcre  -lcurses  -liconv 
> Undefined symbols for architecture arm64:
>   "_s_close", referenced from:
>       _nntp_open in nntplib.o
> ld: symbol(s) not found for architecture arm64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make: *** [tin] Error 1

Thanks for the report. We missed to adjust the s_close() to close() in some
code path when moving from stdio to own buffer implementation; the following
patch should fix that.

=== modified file 'src/nntplib.c'
--- src/nntplib.c	2022-12-25 11:00:37 +0000
+++ src/nntplib.c	2022-12-29 07:56:58 +0000
@@ -523,7 +523,7 @@
 		my_fprintf(stderr, _(txt_connection_to), (char *) inet_ntoa(sock_in.sin_addr));
 		perror("");
 #			endif /* HAVE_INET_NTOA */
-		(void) s_close(s);
+		(void) close(s);
 	}
 
 	if (x < 0) {
@@ -552,7 +552,7 @@
 	if (connect(s, (struct sockaddr *) &sock_in) < 0) {
 		save_errno = errno;
 		perror("connect");
-		(void) s_close(s);
+		(void) close(s);
 		return -save_errno;
 	}
 
@@ -571,7 +571,7 @@
 	if (connect(s, (struct sockaddr *) &sock_in, sizeof(sock_in)) < 0) {
 		save_errno = errno;
 		perror("connect");
-		(void) s_close(s);
+		(void) close(s);
 		return -save_errno;
 	}
 
@@ -723,7 +723,7 @@
 
 	if (connect(s, (struct sockaddr *) &sdn, sizeof(sdn)) < 0) {
 		nerror("connect");
-		s_close(s);
+		close(s);
 		return -1;
 	}
 




More information about the tin-dev mailing list