[libvirt] FreeBSD and sys/syslimits.h

libvirtd.h includes sys/syslimits.h if available. On FreeBSD the header contains this warning: In file included from libvirtd.h:42, from dispatch.h:28, from dispatch.c:30: /usr/include/sys/syslimits.h:41:2: warning: #warning "No user-serviceable parts inside." Here's the relevant part from that header: #if !defined(_KERNEL) && !defined(_LIMITS_H_) && !defined(_SYS_PARAM_H_) #ifndef _SYS_CDEFS_H_ #error this file needs sys/cdefs.h as a prerequisite #endif #ifdef __CC_SUPPORTS_WARNING #warning "No user-serviceable parts inside." #endif #endif This looks like this header is not meant to be included directly, at least on FreeBSD. Is this something gnulib or libvirt should care about? Matthias

On Sat, May 14, 2011 at 06:49:40PM +0200, Matthias Bolte wrote:
libvirtd.h includes sys/syslimits.h if available. On FreeBSD the header contains this warning:
In file included from libvirtd.h:42, from dispatch.h:28, from dispatch.c:30: /usr/include/sys/syslimits.h:41:2: warning: #warning "No user-serviceable parts inside."
Here's the relevant part from that header:
#if !defined(_KERNEL) && !defined(_LIMITS_H_) && !defined(_SYS_PARAM_H_) #ifndef _SYS_CDEFS_H_ #error this file needs sys/cdefs.h as a prerequisite #endif #ifdef __CC_SUPPORTS_WARNING #warning "No user-serviceable parts inside." #endif #endif
This looks like this header is not meant to be included directly, at least on FreeBSD.
And on my linux box syslimits.h seems to come from gcc, verbatim: --------------------------------------------- /* syslimits.h stands for the system's own limits.h file. If we can use it ok unmodified, then we install this text. If fixincludes fixes it, then the fixed version is installed instead of this text. */ #define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */ #include_next <limits.h> #undef _GCC_NEXT_LIMITS_H --------------------------------------------- Shouldn't we just include <limits.h> directly ? Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

<sys/syslimits.h> is not standardized, so portable programs should not need to rely on it. If there really is something that we need where <sys/syslimits.h> provided the limit but <limits.h> did not, then that would be a candidate for fixing in gnulib. But this patch did not turn up any compilation failures on Linux. * src/internal.h (includes): Drop unused header. * daemon/libvirtd.h (includes): Likewise. * configure.ac (AC_CHECK_HEADERS): Likewise. Based on a report by Matthias Bolte. --- configure.ac | 2 +- daemon/libvirtd.h | 4 ---- src/internal.h | 4 ---- 3 files changed, 1 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 4f5c2d7..233e4af 100644 --- a/configure.ac +++ b/configure.ac @@ -133,7 +133,7 @@ AC_CHECK_FUNCS([pthread_sigmask pthread_mutexattr_init]) LIBS=$old_libs dnl Availability of various common headers (non-fatal if missing). -AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h sys/un.h \ +AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/un.h \ sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \ sys/un.h sys/syscall.h]) diff --git a/daemon/libvirtd.h b/daemon/libvirtd.h index d37c3fd..ea00d5c 100644 --- a/daemon/libvirtd.h +++ b/daemon/libvirtd.h @@ -38,10 +38,6 @@ # include <dbus/dbus.h> # endif -# ifdef HAVE_SYS_SYSLIMITS_H -# include <sys/syslimits.h> -# endif - # include <rpc/types.h> # include <rpc/xdr.h> # include "remote_protocol.h" diff --git a/src/internal.h b/src/internal.h index 0fa097c..5747a90 100644 --- a/src/internal.h +++ b/src/internal.h @@ -18,10 +18,6 @@ # define sa_assert(expr) /* empty */ # endif -# ifdef HAVE_SYS_SYSLIMITS_H -# include <sys/syslimits.h> -# endif - /* The library itself is allowed to use deprecated functions / * variables, so effectively undefine the deprecated attribute * which would otherwise be defined in libvirt.h. -- 1.7.4.4

On Mon, May 16, 2011 at 01:29:40PM -0600, Eric Blake wrote:
<sys/syslimits.h> is not standardized, so portable programs should not need to rely on it. If there really is something that we need where <sys/syslimits.h> provided the limit but <limits.h> did not, then that would be a candidate for fixing in gnulib. But this patch did not turn up any compilation failures on Linux.
* src/internal.h (includes): Drop unused header. * daemon/libvirtd.h (includes): Likewise. * configure.ac (AC_CHECK_HEADERS): Likewise. Based on a report by Matthias Bolte.
ACK, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On 05/17/2011 12:32 AM, Daniel Veillard wrote:
On Mon, May 16, 2011 at 01:29:40PM -0600, Eric Blake wrote:
<sys/syslimits.h> is not standardized, so portable programs should not need to rely on it. If there really is something that we need where <sys/syslimits.h> provided the limit but <limits.h> did not, then that would be a candidate for fixing in gnulib. But this patch did not turn up any compilation failures on Linux.
* src/internal.h (includes): Drop unused header. * daemon/libvirtd.h (includes): Likewise. * configure.ac (AC_CHECK_HEADERS): Likewise. Based on a report by Matthias Bolte.
ACK,
Thanks; pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (3)
-
Daniel Veillard
-
Eric Blake
-
Matthias Bolte