Andre Majorel <[EMAIL PROTECTED]> writes:
> gcc -I. -I. -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\"
>-DLOCALEDIR=\"/usr/local/share/locale\" -O2 -Wall -Wno-implicit -c connect.c
> connect.c: In function `test_socket_open':
> connect.c:190: warning: passing arg 2 of `select' from incompatible pointer type
> connect.c: In function `select_fd':
> connect.c:283: warning: passing arg 2 of `select' from incompatible pointer type
> connect.c:283: warning: passing arg 3 of `select' from incompatible pointer type
> connect.c:283: warning: passing arg 4 of `select' from incompatible pointer type
>
> (These are just warnings.)
And weird ones, too. These arguments are of type "pointer to
fd_set". What would HPUX like to see there?
> gcc -I. -I. -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\"
>-DLOCALEDIR=\"/usr/local/share/locale\" -O2 -Wall -Wno-implicit -c host.c
> host.c: In function `lookup_host':
> host.c:258: `h_errno' undeclared (first use in this function)
> host.c:258: (Each undeclared identifier is reported only once
> host.c:258: for each function it appears in.)
>
> Apparently, h_errno is not declared at all under HP-UX (ie.
> find /usr/include -follow -type f | xargs grep h_errno turns
> up nothing). Declaring h_errno (extern int h_errno;) fixes
> the problem. I suppose we need something like :
>
> #if HPUX
> extern int h_errno;
> #endif
I think I'll use something like:
#ifndef h_errno
extern int h_errno;
#endif
(But I'll also exclude Cygwin, which fails when you declare h_errno,
but still doesn't #define it.)
> Problem #3 :
>
> gcc -I. -I. -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\"
>-DLOCALEDIR=\"/usr/local/share/locale\" -O2 -Wall -Wno-implicit -c snprintf.c
> snprintf.c: In function `dopr':
> snprintf.c:311: `short int' is promoted to `int' when passed through `...'
> snprintf.c:311: (so you should pass `int' not `short int' to `va_arg')
> snprintf.c:323: `short unsigned int' is promoted to `int' when passed through
>`...'
> snprintf.c:335: `short unsigned int' is promoted to `int' when passed through
>`...'
> snprintf.c:349: `short unsigned int' is promoted to `int' when passed through
>`...'
>
> GCC has become very annoying with that sort of things... I did
> the suggested changes and the error messages vanished.
Two questions here:
* Does HPUX really not have snprintf()? It sounds weird that a modern
OS wouldn't have it.
* short int is promoted to int, ok. Does that go for all the
architectures, or just some? Should I simply replace "short int"
with "int" to get it to compile?
> - OSF/1 4.0, alpha, DEC C 5.6
>
> Problem #1 :
>
> cc -std1 -I. -I. -DHAVE_CONFIG_H
> -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\"
> -DLOCALEDIR=\"/usr/local/share/locale\" -O -Olimit 2000 -c
> host.c
> cc: Error: host.c, line 221: In the initializer for lst[0],
> "tmpstore" does not have a constant address, but occurs in a
> context that requires an address constant. This is an
> extension of the language.
> char *lst[] = { tmpstore, NULL };
> ----------------------^
>
> The error message is misleading, IMO. The real problem is that
> we're initialising an auto array, which is something C does
> not support, at least not C89/C90.
Indeed. I wonder why I thought that was legal C. Ok, I'll apply your
patch.
> Problem #2 :
>
> There is also this shit. Take a deep breath :
>
> cc: Warning: snprintf.c, line 128: In this declaration, type "signed long
>long" is a language extension.
> LLONG value, int base, int min, int max, int flags);
> -------------------^
Oh yes, you'll have to use `-Ae' or something, to enable the
extensions. Wget doesn't *require* long long, but it's really nice to
have it, so I'll not remove support for it because of warnings...
Thanks a lot for testing this.