Inetutils FTP client and GCC4

William Harrington kb0iic at charter.net
Wed Aug 24 18:04:03 PDT 2005


There were previous patches flying around attempting to change cmdtab[] to *cmdtab which cause
cmdtab->c_name and cmdtab->c_help to automatically be out of bounds when ftp started. That way
breaks it for any version of gcc cause it isn't the proper way to do it with cmdtab structure. The correct
way is to move the extern struct declaration after the struct has been declared which is gcc4's way of
doing things now.

http://webpages.charter.net/kb0iic/inetutils-1.4.2-gcc4-1.patch.bz2

Submitted By: William Harrington <kb0iic at hotmail.com>
Date: 2005-08-24
Initial Package Version: 1.4.2
Upstream Status: Submitted
Origin: William Harrington
Description: Fixed order of processing so declaration is after structure.
             Fixed invalid lvalue in assignment.

diff -Naur inetutils-1.4.2.orig/ftp/extern.h inetutils-1.4.2/ftp/extern.h
--- inetutils-1.4.2.orig/ftp/extern.h   2000-08-09 00:44:23.000000000 -0500
+++ inetutils-1.4.2/ftp/extern.h        2005-08-24 19:43:56.000000000 -0500
@@ -137,7 +137,6 @@

 extern jmp_buf abortprox;
 extern int     abrtflag;
-extern struct  cmd cmdtab[];
 extern FILE    *cout;
 extern int     data;
 extern char    *home;
diff -Naur inetutils-1.4.2.orig/ftp/ftp_var.h inetutils-1.4.2/ftp/ftp_var.h
--- inetutils-1.4.2.orig/ftp/ftp_var.h  2000-07-07 20:00:53.000000000 -0500
+++ inetutils-1.4.2/ftp/ftp_var.h       2005-08-24 19:44:15.000000000 -0500
@@ -120,6 +120,8 @@
        void    (*c_handler) __P((int, char **)); /* function to call */
 };

+extern struct   cmd cmdtab[];
+
 struct macel {
        char mac_name[9];       /* macro name */
        char *mac_start;        /* start of macro in macbuf */
diff -Naur inetutils-1.4.2.orig/libinetutils/ttymsg.c inetutils-1.4.2/libinetutils/ttymsg.c
--- inetutils-1.4.2.orig/libinetutils/ttymsg.c  2001-11-01 09:52:19.000000000 -0600
+++ inetutils-1.4.2/libinetutils/ttymsg.c       2005-08-24 19:43:35.000000000 -0500
@@ -132,7 +132,7 @@
            }
          if (wret)
            {
-             (char *)iov->iov_base += wret;
+             iov->iov_base = (char *)iov->iov_base + wret;
              iov->iov_len -= wret;
            }
          continue;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inetutils-1.4.2-gcc4-1.patch.bz2
Type: application/octet-stream
Size: 763 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-dev/attachments/20050824/ca38cdd6/attachment.obj>


More information about the lfs-dev mailing list