Subject: Re: KLH10 Compile question and an answer!! Success!
To: bob smith <sfmc68@bellatlantic.net>
From: Jason Thorpe <thorpej@wasabisystems.com>
List: port-alpha
Date: 05/10/2003 12:01:42
On Friday, May 9, 2003, at 03:04 PM, bob smith wrote:
> # This auxiliary file is needed to get around a bug in the NetBSD
> # /usr/include files. <stdio.h> includes <sys/types.h> which includes
> # <machine/types.h> which incorrectly exposes a typedef of vaddr_t
> (normally
> # a kernel only type), thus conflicting with KLH10's vaddr_t.
> # By including this file ahead of any other source files (see the
> -include
> # in CENVFLAGS) we can nullify the typedef.
> # And while we're at it, blast paddr_t for the same reason.
>
> netbsd-sucks.h:
> @echo '/* DO NOT EDIT - dynamically generated, see Makefile */' >
> $@
> @echo "#define vaddr_t _kernel_vaddr_t" >> $@
> @echo "#define paddr_t _kernel_paddr_t" >> $@
> @echo "#include <sys/types.h>" >> $@
> @echo "#undef paddr_t" >> $@
> @echo "#undef vaddr_t" >> $@
Nonsense. I seem to recall that identifiers that end in _t are
reserved for the system in ISO C, and thus user applications that
define them themselves are incorrect. I.e. it's KLH10 that is buggy
for defining its own vaddr_t and paddr_t types. Instead, it should
choose another name, like "klh10_vaddr" and "klh10_paddr".
-- Jason R. Thorpe <thorpej@wasabisystems.com>