From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68717 invoked by alias); 6 Dec 2019 16:21:44 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 68706 invoked by uid 89); 6 Dec 2019 16:21:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=HTo:U*mark X-Spam-Status: No, score=-6.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (207.211.31.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Dec 2019 16:21:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575649301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q+YLtvOdRNtz9DM/ep4rjgf3wchyExAqVmBo3yxVMqM=; b=JRH3Cnsh4TYWvGFnMfj3lCZmzX0yNvguju/x5/SOPxjoW3/THOaedgXpsosUN7lmruKitD /4Yt2AaQiX+XfqA3DNXBlOaMoMpKcsSKoyFsDsKzTQ5DcrsWrLQJS3KMafmhUkEh9kxsme bPrahW5tZMamNGsSBo830CQSz68z88I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-323-64daPu1cMrGaPBFBCWAqhA-1; Fri, 06 Dec 2019 11:21:37 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 936A418543A1; Fri, 6 Dec 2019 16:21:36 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-117-142.ams2.redhat.com [10.36.117.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88EB66B8F0; Fri, 6 Dec 2019 16:21:35 +0000 (UTC) From: Florian Weimer To: Mark Wielaard Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH] tests: Add break to avoid implicit-fallthrough warning References: <20191206144149.3696-1-mark@klomp.org> Date: Fri, 06 Dec 2019 16:21:00 -0000 In-Reply-To: <20191206144149.3696-1-mark@klomp.org> (Mark Wielaard's message of "Fri, 6 Dec 2019 15:41:49 +0100") Message-ID: <87wob9ctma.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 64daPu1cMrGaPBFBCWAqhA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-q4/txt/msg00238.txt.bz2 * Mark Wielaard: > For some reason gcc might fail to recognize the assert (0) will never > return and emit an implicit-fallthrough warning. Just add a break to > silence it. Is this with -DNDEBUG? assert (0) expands to basically nothing in that case. I'm not sure if we should change that. We cannot realistically emit __builtin_unreachable in that case, I think, because it would make writing incorrect asserts *really* risky with -DNDEBUG. Thanks, Florian