Bug#673431: libkvm-dev: kvm.h requires sys/types.h

2012-05-19 Thread Robert Millan
2012/5/18 Steven Chamberlain ste...@pyro.eu.org:
 On 18/05/12 17:52, Sebastian Harl wrote:
 /usr/include/kvm.h requires sys/types.h:

 I think that is deliberate, and the user is expected to include it
 first;

Uhm no.  You should check such things on FreeBSD before jumping to
conclusions :-)

The origin of this is rev 184135 in GCC SVN.  This fix isn't present
in older GCC, and as workaround we have a nasty s/__size_t/size_t/
kludge in kfreebsd-kernel-headers.

-- 
Robert Millan



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#673431: libkvm-dev: kvm.h requires sys/types.h

2012-05-19 Thread Steven Chamberlain
On 14:08, Robert Millan wrote:
 2012/5/18 Steven Chamberlain ste...@pyro.eu.org:
  On 18/05/12 17:52, Sebastian Harl wrote:
  /usr/include/kvm.h requires sys/types.h:
 
  I think that is deliberate, and the user is expected to include it
  first;
 
 Uhm no.  You should check such things on FreeBSD before jumping to
 conclusions :-)

I don't even know why I said that now...  s/think/suspect maybe/

So due to this kludge, some headers must now include sys/types.h, because on 
upstream FreeBSD the appropriate definition would be been provided by GCC?  The 
new typename is fairly self-documenting now anyway. :)

I'm still confused why some of the kkh /tests/*.c include kern/sys/types.h

Regards,
-- 
Steven Chamberlain
ste...@pyro.eu.org



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#673431: libkvm-dev: kvm.h requires sys/types.h

2012-05-19 Thread Steven Chamberlain
On 14:44, Steven Chamberlain wrote:
 So due to this kludge, some headers must now include sys/types.h

Ummm that's probably not true either, I've just saw the commit fixing this.
-- 
Steven Chamberlain
ste...@pyro.eu.org



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#673431: libkvm-dev: kvm.h requires sys/types.h

2012-05-19 Thread Robert Millan
2012/5/19 Steven Chamberlain ste...@pyro.eu.org:
 So due to this kludge, some headers must now include sys/types.h, because on 
 upstream FreeBSD the appropriate definition would be been provided by GCC?

No, headers can rely on stddef.h for size_t as usual.

It's just kvm.h which tries to be smart and define size_t on its own,
using the __size_t from kkh.  But unlike FreeBSD we can't have
__size_t, because __size_t would break GCC  4.7.

 I'm still confused why some of the kkh /tests/*.c include kern/sys/types.h

Well each test would have its own reasons.  Which one do you have in mind?

-- 
Robert Millan



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#673431: libkvm-dev: kvm.h requires sys/types.h

2012-05-18 Thread Sebastian Harl
Package: libkvm-dev
Version: 9.0+ds1-2
Severity: important

Hi,

/usr/include/kvm.h requires sys/types.h:

  tokkee@kfreebsd:~$ cat kvm-test.c 
  #include kvm.h
  int main(void) { return 0; }
  tokkee@kfreebsd:~$ gcc kvm-test.c 
  In file included from kvm-test.c:1:0:
  /usr/include/kvm.h:45:1: error: unknown type name ‘__size_t’
  /usr/include/kvm.h:45:18: error: conflicting types for ‘size_t’
  In file included from /usr/include/machine/_types.h:8:0,
   from /usr/include/sys/_types.h:33,
   from /usr/include/kvm.h:37,
   from kvm-test.c:1:
  /usr/include/machine-amd64/_types.h:85:20: note: previous declaration of 
‘size_t’ was here

Including sys/types.h before kvm.h fixes that issue.

It would be nice if either kvm.h includes sys/types.h itself or if the
documentation mentions the fact, that sys/types.h needs to be included
first (which is not currently the case and which is why I think, this is
not intended and thus severity important ;-)).

TIA,
Sebastian

-- 
Sebastian tokkee Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin



signature.asc
Description: Digital signature


Bug#673431: libkvm-dev: kvm.h requires sys/types.h

2012-05-18 Thread Steven Chamberlain
user debian-...@lists.debian.org
usertags 673431 kfreebsd
thanks

Hi,

On 18/05/12 17:52, Sebastian Harl wrote:
 /usr/include/kvm.h requires sys/types.h:

I think that is deliberate, and the user is expected to include it
first;  I have no idea if or where this is documented, but I'm sure it
should be :)

Regards,
-- 
Steven Chamberlain
ste...@pyro.eu.org



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org




Bug#673431: libkvm-dev: kvm.h requires sys/types.h

2012-05-18 Thread Sebastian Harl
Hi,

On Fri, May 18, 2012 at 06:25:50PM +0100, Steven Chamberlain wrote:
 On 18/05/12 17:52, Sebastian Harl wrote:
  /usr/include/kvm.h requires sys/types.h:
 
 I think that is deliberate, and the user is expected to include it
 first;

Well, I usually expect headers to be self-contained ;-) But that may
just be my personal preference ;-)

 I have no idea if or where this is documented, but I'm sure it
 should be :)

The kvm_*(3) manpages would be a a good place imho. E.g. kvm_open(3)
documents, that fcntl.h is required as well.

TIA,
Sebastian

-- 
Sebastian tokkee Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin



signature.asc
Description: Digital signature