[squid-users] Squid on NetBSD 1.5.2

From: Ray Phillips <r.phillips@dont-contact.us>
Date: Mon, 18 Mar 2002 19:13:29 +1000

Dear Squid-users:

I've downloaded an auto-generated tarball, viz.
squid-2.4-200203160000-src.tar.gz, and found there's a problem
compiling it on NetBSD 1.5.2. There's no difficulty in NetBSD 1.4.1,
the only other version I have access to at the moment. I'm annoyed
to say that I can't solve it for myself, not yet anyway.

In 1.5.2 configure runs smoothly but make generates 112 errors about
fd_mask being redefined, like this:

Making all in lib...
make[1]: Entering directory
`/usr/home1/ray/installers/squid/squid-2.4-200203160
000/lib'
gcc -g -O2 -Wall -I../include -I../include -c -o rfc1123.o rfc1123.c
In file included from /usr/include/stdio.h:45,
                  from rfc1123.c:44:
/usr/include/sys/types.h:219: warning: `fd_mask' redefined
../include/autoconf.h:240: warning: this is the location of the
previous definit
ion

As the message says, this redefinition of fd_mask results from
/usr/include/sys/types.h being included in /usr/include/stdio.h by
this code:

#if !defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__)
#include <sys/types.h>
#endif

<sys/types.h> contains these lines:

typedef int32_t __fd_mask;

#ifndef _XOPEN_SOURCE

#define NBBY __NBBY
#define fd_mask __fd_mask
#define NFDBITS __NFDBITS
#ifndef howmany
#define howmany(a, b) __howmany(a, b)
#endif

fd_mask is defined in include/autoconf.h with

#define fd_mask int

In 1.4.1 /usr/include/sys/types.h contains

typedef int32_t fd_mask;

but has no #define fd_mask line.

I don't see why <sys/types.h> is included in <stdio.h> since I would
have thought _ANSI_SOURCE or __STRICT_ANSI__ would have been defined.

In case it's useful here's diff's output for ./configure on 1.4.1 and 1.5.2:

2c2
< checking host system type... alpha-unknown-netbsd1.4.1

---
>  checking host system type... alpha-unknown-netbsd1.5.2
38c38
< checking for getopt.h... no
---
>  checking for getopt.h... yes
112c112
< checking for fd_mask... yes
---
>  checking for fd_mask... no
Could someone offer assistance please?
Ray
Received on Mon Mar 18 2002 - 02:13:43 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:06:57 MST