From owner-svn-src-all@freebsd.org Wed Mar 7 15:54:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D4BDF39BDF; Wed, 7 Mar 2018 15:54:07 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot0-x236.google.com (mail-ot0-x236.google.com [IPv6:2607:f8b0:4003:c0f::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 28E387C66B; Wed, 7 Mar 2018 15:54:07 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot0-x236.google.com with SMTP id h8so2476306oti.6; Wed, 07 Mar 2018 07:54:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4jrs60oonPnDZrNkK8Kjm+B8VI639MC1L7nMylZbQz4=; b=u6NvRcLm0irgAT+WJ+4l8D3ydW5qfT9zniftaMs1PB9hGbqcXvdYh9/4Wnic3/D3yt EVA78uBIDkwn5gQJmYOcrYLdcP5M6Lbr81FGjSm+avc3WMnGVO4wpCgUqacCksx6Kvq4 34MULY/0jHL/T19JLZxFdL8gv1PYPcFCJGjYS1hl1PlWni+IGSS2NNO+thN3it///QPN Wl0p3d5YrcxXZhzWaiyq4aJFLuKhZu4DgIvDlIf+6mYpZR/bnBDXoVT/ULIrtdN94rOD otukIhEwwJbYXnWHl5ZF79DK7awZIK4O6JcYo8PBN3Vxo4GkHfgJB/Ryc5tLBiS8+KGh dyYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4jrs60oonPnDZrNkK8Kjm+B8VI639MC1L7nMylZbQz4=; b=NM1/E9A3/ifCaLeDmNgKVrpbpRvIkQl7rL0PhSZhPDv+Utt+UACK9msk+T+ADj46Tf /36m/gNoT3LS+tpq8SwO/069O8ZZ/YPLgTGcjEYopcr4Qm8bv2WmBlwTgznTiSgUFG0p cfWxS5It9vKgbJA/Fd+aLnR5V/PIeG0sUR/bvSJu7ufNO7OtXIUYvAqzI6iN5jiuc0sU q8WfHOJSDNdQVchpW8PnZbqUZ35q9ppI8r6BBVDXOtDxq7M/lKYnLpG0C2U60nir6H2Y g49TjbJ/BGfPrtX314He1LW+1+OXDihC9lIt6oXCBc1C42DN7BigmP0HSQaM8+qd+Pxg Yhcw== X-Gm-Message-State: AElRT7E1XCJH8kZxy2uRxz8bxJ+38dq/tAnQoQlZf5nbGqhCVAWBd1iK 56M9n7X/VfrzvQJO0kS5tW7V9zjYl3a4SzS9des= X-Google-Smtp-Source: AG47ELsMOF35VhC+vmlmRkXPxx8YSkRbiuqfSZoQ/C7Kh7/mgqYOCsPpDgpni4r4I3qe813SqjIfrArapBACi7LVF0w= X-Received: by 10.157.62.30 with SMTP id a30mr16139974otd.128.1520438046317; Wed, 07 Mar 2018 07:54:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.96.212 with HTTP; Wed, 7 Mar 2018 07:54:05 -0800 (PST) In-Reply-To: References: <201803071447.w27Elh7C053393@repo.freebsd.org> From: Benjamin Kaduk Date: Wed, 7 Mar 2018 09:54:05 -0600 Message-ID: Subject: Re: svn commit: r330602 - head/sys/compat/cloudabi To: Ed Maste Cc: Eitan Adler , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 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: Wed, 07 Mar 2018 15:54:08 -0000 On Wed, Mar 7, 2018 at 9:44 AM, Ed Maste wrote: > On 7 March 2018 at 09:47, Eitan Adler wrote: > > Author: eadler > > Date: Wed Mar 7 14:47:43 2018 > > New Revision: 330602 > > URL: https://svnweb.freebsd.org/changeset/base/330602 > > > > Log: > > sys/cloudabi: Avoid relying on GNU specific extensions > > > > An empty initializer list is not technically valid C grammar. > > > > MFC After: 1 week > > > > - cloudabi_fdstat_t fsb = {}; > > + cloudabi_fdstat_t fsb = {0}; > > In practice it appears initializing via { 0 } also zeros any padding > in the struct, but I do not believe it's required by the C standard. > Perhaps a language lawyer can weigh in? > > Commenting on this commit just because it's highlighted by this > change; I do not believe there's a difference between the GNU > extension { } and { 0 } here. > > The C spec says that if an incomplete initializer is given, then all other fields of the structure are initialized to zero. The state of padding is unspecified, whether a complete or incomplete initializer is given. The "issue" being "fixed" here is that the formal C grammar does not admit a totally empty initializer, so at least one element of the initializer needs to be given in order to satisfy the grammar. This is pretty silly, and the extension to allow a totally empty initializer a quite natural one to make. -Ben