Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2013 15:49:42 -0500 (EST)
From:      "J.R. Oldroyd" <fbsd@opal.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/176300: __CTASSERT() missing from <sys/cdefs.h>
Message-ID:  <201302202049.r1KKngRK085644@shibato.opal.com>
Resent-Message-ID: <201302202050.r1KKo04F054224@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         176300
>Category:       bin
>Synopsis:       __CTASSERT() missing from <sys/cdefs.h>
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 20 20:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     J.R. Oldroyd
>Release:        FreeBSD 9.1-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD xx.opal.com 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r244985: Tue Jan 8 10:51:13 EST 2013 jr@xx.opal.com:/usr/src/sys/amd64/compile/GENERIC amd64
>Description:
NetBSD has declarations of __CTASSERT() in <sys/cdefs.h>.  We only have it in
<sys/systm.h> which is a kernel space header.  Since we are mirroring code from
NetBSD that might use __CTASSERT() in user space, e.g., vis(3), we need to add
or move __CTASSERT().
>How-To-Repeat:
n/a
>Fix:
The NetBSD code in <sys/cdefs.h> is:
/*
 * Compile Time Assertion.
 */
#ifdef __COUNTER__
#define __CTASSERT(x)		__CTASSERT0(x, __ctassert, __COUNTER__)
#else
#define __CTASSERT(x)		__CTASSERT0(x, __ctassert, __LINE__)
#endif
#define __CTASSERT0(x, y, z)	__CTASSERT1(x, y, z)
#define __CTASSERT1(x, y, z)	typedef char y ## z[(x) ? 1 : -1];
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302202049.r1KKngRK085644>