The wget-1.8.1 release is evidently intended to be buildable with
old-style K&R compilers, since it automatically detects this, and
filters the source code with ansi2knr.

Unfortunately, there are some syntactical things in the wget source
code that ansi2knr cannot recognize, and they prevent a successful
build with such a compiler (in my case, cc on HP-UX 10.01, with no c89
or gcc available on that system).

(Bundled) cc: "cookies.c", line 87: error 1701: Unsigned suffix is an ANSI feature.
(Bundled) cc: "ftp.h", line 104: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "hash.c", line 139: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "hash.c", line 140: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "hash.c", line 180: error 1701: Unsigned suffix is an  ANSI feature.
(Bundled) cc: "hash.c", line 180: error 1701: Unsigned suffix is an  ANSI feature.
(Bundled) cc: "hash.c", line 239: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "hash.c", line 339: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "http.c", line 317: error 1580: Formal parameter "fd" is not in 
parameter list.
(Bundled) cc: "http.c", line 379: error 1580: Formal parameter "port" is not in 
parameter list.
(Bundled) cc: "log.c", line 474: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "log.c", line 514: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "netrc.c", line 238: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "progress.c", line 44: error 1705: Function prototypes are an ANSI 
feature.
(Bundled) cc: "progress.c", line 45: error 1705: Function prototypes are an ANSI 
feature.
(Bundled) cc: "progress.c", line 46: error 1705: Function prototypes are an ANSI 
feature.
(Bundled) cc: "progress.c", line 47: error 1705: Function prototypes are an ANSI 
feature.

Here are patches that I applied to get a successful build [I dealt
with the log.c problem by manually inserting

        #undef HAVE_STDARG_H

in config.h, to force it to use the old-style varargs interface.]

*** cookies.c.~1~       Sun Dec  9 19:29:11 2001
--- cookies.c   Sat Feb 23 07:39:57 2002
***************
*** 84,90 ****
  
    /* If we don't know better, assume cookie is non-permanent and valid
       for the entire session. */
!   cookie->expiry_time = ~0UL;
  
    /* Assume default port. */
    cookie->port = 80;
--- 84,90 ----
  
    /* If we don't know better, assume cookie is non-permanent and valid
       for the entire session. */
!   cookie->expiry_time = ~((unsigned long)0);
  
    /* Assume default port. */
    cookie->port = 80;
*** ftp.h.~1~   Wed Nov 21 17:24:27 2001
--- ftp.h       Sat Feb 23 07:34:49 2002
***************
*** 101,107 ****
--- 101,111 ----
  struct fileinfo *ftp_parse_ls PARAMS ((const char *, const enum stype));
  uerr_t ftp_loop PARAMS ((struct url *, int *));
  
+ #if defined(__STDC__)
  uerr_t ftp_index (const char *, struct url *, struct fileinfo *);
+ #else
+ uerr_t ftp_index ();
+ #endif
  
  char ftp_process_type PARAMS ((const char *));
  
*** hash.c.~1~  Sat Nov 17 11:03:57 2001
--- hash.c      Sat Feb 23 07:47:42 2002
***************
*** 136,143 ****
--- 136,148 ----
  };
  
  struct hash_table {
+ #if defined(__STDC__)
    unsigned long (*hash_function) (const void *);
    int (*test_function) (const void *, const void *);
+ #else
+   unsigned long (*hash_function) ();
+   int (*test_function) ();
+ #endif
  
    int size;                   /* size of the array */
    int count;                  /* number of non-empty, non-deleted
***************
*** 177,183 ****
--- 182,194 ----
      10445899, 13579681, 17653589, 22949669, 29834603, 38784989,
      50420551, 65546729, 85210757, 110774011, 144006217, 187208107,
      243370577, 316381771, 411296309, 534685237, 695090819, 903618083,
+ #if defined(__STDC__)
      1174703521, 1527114613, 1985248999, 2580823717UL, 3355070839UL
+ #else
+     1174703521, 1527114613, 1985248999,
+     (unsigned long)0x99d43ea5, (unsigned long)0xc7fa5177
+ #endif
+ 
    };
    int i;
    for (i = 0; i < ARRAY_SIZE (primes); i++)
***************
*** 236,242 ****
--- 247,257 ----
    struct mapping *mappings = ht->mappings;
    int size = ht->size;
    struct mapping *mp = mappings + HASH_POSITION (ht, key);
+ #if defined(__STDC__)
    int (*equals) (const void *, const void *) = ht->test_function;
+ #else
+   int (*equals) () = ht->test_function;
+ #endif
  
    LOOP_NON_EMPTY (mp, mappings, size)
      if (equals (key, mp->key))
***************
*** 336,342 ****
--- 351,361 ----
  {
    struct mapping *mappings = ht->mappings;
    int size = ht->size;
+ #if defined(__STDC__)
    int (*equals) (const void *, const void *) = ht->test_function;
+ #else
+   int (*equals) () = ht->test_function;
+ #endif
  
    struct mapping *mp = mappings + HASH_POSITION (ht, key);
  
*** http.c.~1~  Thu Dec 13 09:46:56 2001
--- http.c      Sat Feb 23 07:53:22 2002
***************
*** 313,325 ****
  
     If a previous connection was persistent, it is closed. */
  
- static void
- register_persistent (const char *host, unsigned short port, int fd
  #ifdef HAVE_SSL
!                    , SSL *ssl
! #endif
!                    )
  {
    if (pc_active_p)
      {
        if (pc_last_fd == fd)
--- 313,327 ----
  
     If a previous connection was persistent, it is closed. */
  
  #ifdef HAVE_SSL
! static void
! register_persistent (const char *host, unsigned short port, int fd, SSL *ssl)
  {
+ #else
+ static void
+ register_persistent (const char *host, unsigned short port, int fd)
+ {
+ #endif
    if (pc_active_p)
      {
        if (pc_last_fd == fd)
***************
*** 375,387 ****
  /* Return non-zero if a persistent connection is available for
     connecting to HOST:PORT.  */
  
- static int
- persistent_available_p (const char *host, unsigned short port
  #ifdef HAVE_SSL
!                       , int ssl
! #endif
!                       )
  {
    int success;
    struct address_list *this_host_ip;
  
--- 377,391 ----
  /* Return non-zero if a persistent connection is available for
     connecting to HOST:PORT.  */
  
  #ifdef HAVE_SSL
! static int
! persistent_available_p (const char *host, unsigned short port, int ssl)
  {
+ #else
+ static int
+ persistent_available_p (const char *host, unsigned short port)
+ {
+ #endif
    int success;
    struct address_list *this_host_ip;
  
*** netrc.c.~1~ Fri Nov 30 02:33:22 2001
--- netrc.c     Sat Feb 23 07:31:44 2002
***************
*** 235,241 ****
     null-terminated string once character to the left.
     Used in processing \ and " constructs in the netrc file */
  static void
! shift_left(char *string){
    char *p;
    
    for (p=string; *p; ++p)
--- 235,242 ----
     null-terminated string once character to the left.
     Used in processing \ and " constructs in the netrc file */
  static void
! shift_left(char *string)
! {
    char *p;
    
    for (p=string; *p; ++p)
*** progress.c.~1~      Sun Dec  9 22:31:45 2001
--- progress.c  Sat Feb 23 07:32:24 2002
***************
*** 41,50 ****
--- 41,57 ----
  
  struct progress_implementation {
    char *name;
+ #if defined(__STDC__)
    void *(*create) (long, long);
    void (*update) (void *, long, long);
    void (*finish) (void *, long);
    void (*set_params) (const char *);
+ #else
+   void *(*create) ();
+   void (*update) ();
+   void (*finish) ();
+   void (*set_params) ();
+ #endif
  };
  
  /* Necessary forward declarations. */

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- Center for Scientific Computing       FAX: +1 801 585 1640, +1 801 581 4148 -
- University of Utah                    Internet e-mail: [EMAIL PROTECTED]  -
- Department of Mathematics, 322 INSCC      [EMAIL PROTECTED]  [EMAIL PROTECTED] -
- 155 S 1400 E RM 233                       [EMAIL PROTECTED]                    -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -
-------------------------------------------------------------------------------

Reply via email to