From owner-svn-src-head@FreeBSD.ORG Fri May 15 17:34:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8BD1F2A for ; Fri, 15 May 2015 17:34:44 +0000 (UTC) Received: from nm4.bullet.mail.bf1.yahoo.com (nm4.bullet.mail.bf1.yahoo.com [98.139.212.163]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74B6B1AE4 for ; Fri, 15 May 2015 17:34:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1431711276; bh=PMnD3SdmT84hGqBSp6NsuLJkqwSeg5Q8/VFmmmWd0HE=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=unPrd6MvU1ldlgPh1eOi0r/UIRf86+jgsD0sYN8OZ4WSORI9qGZd3/+Ew+tSgRVWLPcE4wiDvt+9jHeu62cHYb62zv/oR3V3tp9fePhS/UWWJy5v1hyeevvZ6FQmq1br09eskvXoKyLguOT+IprBsU7cqLDS2AC/U5FJC9Nez/gtko9xmklAzRIuNp6nwMXVnqo7bT9G5tjALqwVs5hIypjCOzt2CJtjB69zrppWTejockVvvYmdPFrdBTcGhecoqrv1a1URfVOdkHXlBrudit8CilAabICAaQhR0LNs6I9oS4IzjKLukbZZEGkJGQyWt6JJelFm2+ybLf4W1NNVqQ== Received: from [66.196.81.171] by nm4.bullet.mail.bf1.yahoo.com with NNFMP; 15 May 2015 17:34:36 -0000 Received: from [98.139.211.194] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 15 May 2015 17:34:36 -0000 Received: from [127.0.0.1] by smtp203.mail.bf1.yahoo.com with NNFMP; 15 May 2015 17:34:36 -0000 X-Yahoo-Newman-Id: 717744.9126.bm@smtp203.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: v7lF6LcVM1ks4febOiDDDYC5icX_Rv.WMuGYK9Wzkhh4GzX 3uK4TTrQ3vImBOzrCjvMTH1bcwE6Fc_8Mlq4NsgrxUUYg7o_ZHnha5noSfS5 EIEjMizySITSM3ZoPNHNoK8TIL6C5T2fynTgg27BMgG1Ip1LQvrMBefQ2yny wFQqjZ0ZdXIvp6W0_RH3QxStGd03a0Z4zzgGXuXpNJr3sJjZ5U6_2MOhVRBB vm0VPhFdO5Fa7gRy4K_HGsMkpEmv3oIT3ACOLrvp6QMAQCMyjqi3BwuuzPUj .fskIOTgIl6qIXcxZIsqtjzq9_rFCJRUx7MgNJ3Iib6IOLWqowwBsYkTztRs J1f9FP7TpJTSg6y5GeXV4MEJeZ_BhFMJSl0Jsnzue6lSK8pceOWMUrGc98AT 6rv17Vdqiaj3X3ciQosOpno2n64gWgTVrq5LcjPsEPS8bv4YOLVYzcTrxzJG QGtyiDTdAGO9vwgnmNQ3Sl9HBpy9aWhivrfwlQ9A2T9n_31lTmS7496ux3gy md2msRMg4bX_r0Nu3MsvmYvyrdTD9XMhP X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <55562E36.1000304@FreeBSD.org> Date: Fri, 15 May 2015 12:34:46 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Tijl Coosemans CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282907 - head/sys/sys References: <201505141549.t4EFnnQg094250@svn.freebsd.org> <20150515123327.45621037@kalimero.tijl.coosemans.org> In-Reply-To: <20150515123327.45621037@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2015 17:34:44 -0000 On 05/15/15 05:33, Tijl Coosemans wrote: > Modified: head/sys/sys/cdefs.h > ============================================================================== > --- head/sys/sys/cdefs.h Thu May 14 15:14:03 2015 (r282906) > +++ head/sys/sys/cdefs.h Thu May 14 15:49:48 2015 (r282907) > @@ -388,6 +388,12 @@ > #define __alloc_size(x) > #endif > > +#if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6) > +#define __unreachable() __builtin_unreachable() > +#else > +#define __unreachable() do {} while (/*CONSTCOND*/0) > __builtin_unreachable() can be used in expressions so I think it's better > to replace do-while with ((void)0). You can then do things like this: > > #define assume(e) ((e) ? (void)0 : __unreachable()) > (like assert(e) but without error) Looks reasonable, thanks! FWIW, there was some discussion about having a debugging macro that warns when such unreachable code is reached. We are just not sure where such a macro belongs, probably not in cdefs. Pedro.