[PATCH] betaftpd buildfix for gcc 4.3.3

Timo Juhani Lindfors timo.lindfors at iki.fi
Fri Jan 23 19:54:38 CET 2009


[ Cc set to upstream author. ]

Trevanian <admin at accg.de> writes:
> I am new to compiling applications for different architectures like ARMv4.
> I'd like to compile the "BetaFTPd", a small and fast single-threaded FTP
> deamon, for the Neo Freerunner. I have only compiled source code within my
> x86 environment and am not familiar with the prerequesites for compiling
> source code for different architectures. 

BetaFTPd does not seem to compile with gcc 4.3.3:

lindi at ginger:~/tmp/betaftpd-0.0.7$ ./configure
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for working const... yes
checking how to run the C preprocessor... gcc -E
checking for unistd.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for socket in -lsocket... no
checking for connect in -lsocket... no
checking for crypt in -lcrypt... yes
checking whether to enable xferlog... no
checking whether to enable fullscreen... no
checking whether to enable fork... no
checking whether to enable upload... no
checking whether to enable shadow... no
checking for unistd.h... (cached) yes
checking for netinet/in.h... yes
checking for time.h... yes
checking for sys/time.h... yes
checking for linux/socket.h... yes
checking for errno.h... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
lindi at ginger:~/tmp/betaftpd-0.0.7$ make
gcc -g -O2 -DHAVE_CONFIG_H -I. -DVERSION=\"0.0.7\" -c ./disp.c
gcc -g -O2 -DHAVE_CONFIG_H -I. -DVERSION=\"0.0.7\" -c ./ftpd.c
In file included from ./ftpd.c:77:
./cmds.h:23:1: error: pasting "cmd_user" and "(" does not give a valid preprocessing token
./cmds.h:24:1: error: pasting "cmd_pass" and "(" does not give a valid preprocessing token
./cmds.h:25:1: error: pasting "cmd_port" and "(" does not give a valid preprocessing token
./cmds.h:26:1: error: pasting "cmd_pasv" and "(" does not give a valid preprocessing token
./cmds.h:27:1: error: pasting "cmd_pwd" and "(" does not give a valid preprocessing token
./cmds.h:28:1: error: pasting "cmd_cwd" and "(" does not give a valid preprocessing token
./cmds.h:29:1: error: pasting "cmd_cdup" and "(" does not give a valid preprocessing token
./cmds.h:30:1: error: pasting "cmd_rest" and "(" does not give a valid preprocessing token
./cmds.h:31:1: error: pasting "cmd_retr" and "(" does not give a valid preprocessing token
./cmds.h:32:1: error: pasting "cmd_size" and "(" does not give a valid preprocessing token
./cmds.h:33:1: error: pasting "cmd_mdtm" and "(" does not give a valid preprocessing token
./cmds.h:34:1: error: pasting "cmd_list" and "(" does not give a valid preprocessing token
./cmds.h:35:1: error: pasting "cmd_nlst" and "(" does not give a valid preprocessing token
./cmds.h:36:1: error: pasting "cmd_syst" and "(" does not give a valid preprocessing token
./cmds.h:37:1: error: pasting "cmd_noop" and "(" does not give a valid preprocessing token
./cmds.h:38:1: error: pasting "cmd_type" and "(" does not give a valid preprocessing token
./cmds.h:39:1: error: pasting "cmd_mode" and "(" does not give a valid preprocessing token
./cmds.h:40:1: error: pasting "cmd_stru" and "(" does not give a valid preprocessing token
./cmds.h:41:1: error: pasting "cmd_quit" and "(" does not give a valid preprocessing token

lindi at ginger:~/tmp/betaftpd-0.0.7$ gcc --version
gcc (Debian 4.3.2-2) 4.3.3 20090110 (prerelease)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Here's a patch:

--- betaftpd-0.0.7.orig/cmds.h  1999-06-26 15:11:32.000000000 +0300
+++ betaftpd-0.0.7.new/cmds.h   2009-01-23 20:47:36.000000000 +0200
@@ -17,7 +17,7 @@

 #include <dirent.h>

-#define CMD_PROTO(cmd) void cmd_ ## cmd ## (struct conn * const c)
+#define CMD_PROTO(cmd) void cmd_ ## cmd (struct conn * const c)

 int do_chdir(struct conn * const c, const char * const newd);
 CMD_PROTO(user);


After that the only warning is

/home/lindi/tmp/betaftpd-0.0.7/./cmds.c:764: warning: the use of `tempnam' is dangerous, better use `mkstemp'



best regards,
Timo Lindfors



More information about the devel mailing list