tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: -D_NETBSD_SOURCE makes headers uncompilable



On Fri 22 Jan 2016 at 21:33:23 +0000, David Holland wrote:
> For headers we control, which is most of the ones in the patch, we
> should just fix them. I'll do it...

Speaking of fixing headers, is it possible to get them fixed such that
vaddr_t doesn't escape? The following program does not compile:

#include <stdlib.h>
/* see if this defines vaddr_t to something different than before */
typedef char vaddr_t;

int
main ()
{
  return 0;
}

$ gcc va.c
va.c:4:14: error: conflicting types for 'vaddr_t'
 typedef char vaddr_t;
              ^
In file included from /usr/include/sys/types.h:45:0,
                 from /usr/include/stdlib.h:41,
                 from va.c:2:
/usr/include/amd64/types.h:53:23: note: previous declaration of 'vaddr_t' was here
 typedef unsigned long vaddr_t;
                       ^

and even this fails (and I don't think C11 allows standard headers to
usurp vaddr_t):

$ gcc --std=c11 va.c
va.c:4:14: error: conflicting types for 'vaddr_t'
 typedef char vaddr_t;
              ^
In file included from /usr/include/sys/types.h:45:0,
                 from /usr/include/stdlib.h:41,
                 from va.c:2:
/usr/include/amd64/types.h:53:23: note: previous declaration of 'vaddr_t' was here
 typedef unsigned long vaddr_t;
                       ^


-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl    -- 'this bath is too hot.'

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index