From owner-freebsd-current@freebsd.org Thu Aug 13 12:05:22 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 685B29B8F35; Thu, 13 Aug 2015 12:05:22 +0000 (UTC) (envelope-from stefanogarzarella@gmail.com) Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com [IPv6:2a00:1450:4010:c04::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E730E3EF; Thu, 13 Aug 2015 12:05:21 +0000 (UTC) (envelope-from stefanogarzarella@gmail.com) Received: by lbbtg9 with SMTP id tg9so25905587lbb.1; Thu, 13 Aug 2015 05:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=Wo7YeQCElLIhMa1aboZCId2O99B+i00OD041wk52y3I=; b=ac3UDvZTiw3YEhmheaV+YM1LukHDdALGycr2g+6GP1rvgXpBBxugeGuCttgtI7NeGt agmQiUgzX4rfvhh5uGmkAGUSG2q+uCdsCO2OVCCbpWoL6Qqqil8pfY7LnWWCI0T2MT8x UG8hxGlNYoboZrdsSkfeuRN8IX8wMWKs6PU+629Hw5x8st0jKc1+2Ff0a9YY+ZIloDdK ucgtsyBwI4HT43vA2/4pKACAEw/LBCORkIWqQfXxGiheAFMzzpvihRrxENqawSKhPCqV SH+K9j6NXNaWJEu5NboSfNpDp/LzJH/Cufdz0wqyhMpA0kQCjqxCTlhBG03yYXZouDVJ FYyA== X-Received: by 10.112.209.106 with SMTP id ml10mr35727401lbc.112.1439467520126; Thu, 13 Aug 2015 05:05:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.216.140 with HTTP; Thu, 13 Aug 2015 05:05:00 -0700 (PDT) From: Stefano Garzarella Date: Thu, 13 Aug 2015 14:05:00 +0200 Message-ID: Subject: bhyve: fix bhyve warning CTASSERT To: freebsd-current , freebsd-virtualization@freebsd.org Cc: Neel Natu , Peter Grehan Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2015 12:05:22 -0000 Hi all, when I compile bhyve, I have the following errors from clang: pci_emul.c:750:2: error: unused typedef '__assert750' [-Werror,-Wunused-local-typedef] CTASSERT(sizeof(struct msicap) == 14); pci_emul.c:776:2: error: unused typedef '__assert776' [-Werror,-Wunused-local-typedef] CTASSERT(sizeof(struct msixcap) == 12); pci_emul.c:928:2: error: unused typedef '__assert928' [-Werror,-Wunused-local-typedef] CTASSERT(sizeof(struct pciecap) == 60); I fixed them in this simple way: diff --git a/bhyverun.h b/bhyverun.h index 87824ef..7ac3aa9 100644 --- a/bhyverun.h +++ b/bhyverun.h @@ -32,7 +32,8 @@ #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] +#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] \ + __unused #endif Cheers, Stefano