From owner-svn-src-all@FreeBSD.ORG Tue Dec 13 20:06:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56DFD106566B; Tue, 13 Dec 2011 20:06:44 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id DD4048FC17; Tue, 13 Dec 2011 20:06:43 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id E05D125D3810; Tue, 13 Dec 2011 20:06:42 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 199A9BD6EE9; Tue, 13 Dec 2011 20:06:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id irFkgl096L+o; Tue, 13 Dec 2011 20:06:41 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id D2FF6BD6EE8; Tue, 13 Dec 2011 20:06:40 +0000 (UTC) Date: Tue, 13 Dec 2011 20:06:40 +0000 (UTC) From: "Bjoern A. Zeeb" To: Ed Schouten In-Reply-To: <201112131939.pBDJdOm4064325@svn.freebsd.org> Message-ID: References: <201112131939.pBDJdOm4064325@svn.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228478 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2011 20:06:44 -0000 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 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.