On Mon, Apr 29, 2013 at 6:36 AM, Brice Goglin <brice.gog...@inria.fr> wrote:
> > but I am getting many other warnings and another > > error on FreeBSD 9.1: > > > > /usr/include/sys/sysctl.h:799: error: expected declaration specifiers or > '...' before 'u_int' > > topology-freebsd.c: In function 'hwloc_freebsd_node_meminfo_info': > > topology-freebsd.c:173: warning: passing argument 2 of 'sysctl' makes > pointer from integer without a cast > > topology-freebsd.c:173: warning: passing argument 5 of 'sysctl' makes > integer from pointer without a cast > > topology-freebsd.c:173: error: too many arguments to function 'sysctl' > > > > > > I wonder if this CFLAGS=-D_POSIX_SOURCE is supported by FreeBSD headers. > > I could not fix this. Google says that FreeBSD does not define u_int > when _POSIX_SOURCE, so the sysctl() prototype cannot be correct. I tend > to think you should remove _POSIX_SOURCE on this FreeBSD release. > sysctl() is not defined by any POSIX standard, right? On FreeBSD, defining _POSIX_SOURCE is intended to suppress definitions of all non-POSIX functions, types, constants, etc. This is different than Linux, but that doesn't make it wrong. See, for instance: http://lists.freebsd.org/pipermail/freebsd-standards/2004-March/000474.html So, what else is one to expect when defining _POSIX_SOURCE and including then including the non-POSIX header sys/sysctl.h? I agree that one cannot expect to build hwloc on FreeBSD w/ strict POSIX source enforced. -Paul -- Paul H. Hargrove phhargr...@lbl.gov Future Technologies Group Computer and Data Sciences Department Tel: +1-510-495-2352 Lawrence Berkeley National Laboratory Fax: +1-510-486-6900