Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Dec 2011 20:06:40 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To:        Ed Schouten <ed@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r228478 - head/sys/sys
Message-ID:  <alpine.BSF.2.00.1112132004490.4603@ai.fobar.qr>
In-Reply-To: <201112131939.pBDJdOm4064325@svn.freebsd.org>
References:  <201112131939.pBDJdOm4064325@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 13 Dec 2011, Ed Schouten wrote:

> Author: ed
> Date: Tue Dec 13 19:39:24 2011
> New Revision: 228478
> URL: http://svn.freebsd.org/changeset/base/228478
>
> Log:
>  Reimplement CTASSERT() using _Static_assert().

Cool, can we have a second variant with a custom error message?
Not having file:line and more information is freakingly unhelpful
often when compiling with -j<high n> and our current default compiler.


> Modified:
>  head/sys/sys/systm.h
>
> Modified: head/sys/sys/systm.h
> ==============================================================================
> --- head/sys/sys/systm.h	Tue Dec 13 19:37:27 2011	(r228477)
> +++ head/sys/sys/systm.h	Tue Dec 13 19:39:24 2011	(r228478)
> @@ -92,10 +92,8 @@ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUES
> } while (0)
> #endif
>
> -#ifndef CTASSERT		/* Allow lint to override */
> -#define	CTASSERT(x)		_CTASSERT(x, __LINE__)
> -#define	_CTASSERT(x, y)		__CTASSERT(x, y)
> -#define	__CTASSERT(x, y)	typedef char __assert ## y[(x) ? 1 : -1]
> +#ifndef CTASSERT	/* Allow lint to override */
> +#define	CTASSERT(x)	_Static_assert(x, "compile-time assertion failed")
> #endif
>
> /*
>

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.



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