From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id A8C105A026D for ; Wed, 2 Aug 2023 10:20:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690964402; 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=P3i2//aCWRamXD8ouZevoPl6oqAZrYSwKLCBTkzBawA=; b=CLBdCQEhEKDwNuOSUXbC/0k2HgPqOT2XJBpjlcJB12ABRp2ViVguDWxr6dF+DL8PonyRIq YkZcoRT5Y10t5mkExo1VBqfh9reRq6fbnfmekRbgq0XY2H72c59kiDKre114Dv3/TdWyUy GuvHFAPgBJoY5kgz0MjjvJJkqJZPUaM= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-261-X7qv7NeOOImjQNIom4AfEw-1; Wed, 02 Aug 2023 04:20:01 -0400 X-MC-Unique: X7qv7NeOOImjQNIom4AfEw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DAC673C0C49D; Wed, 2 Aug 2023 08:20:00 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 419BC112132D; Wed, 2 Aug 2023 08:20:00 +0000 (UTC) Date: Wed, 2 Aug 2023 10:19:58 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 0/3] RFC: Allow C11 extensions in the passt/pasta code Message-ID: <20230802101958.5fae7809@elisabeth> In-Reply-To: References: <20230801033647.2135844-1-david@gibson.dropbear.id.au> <20230801101527.6cbdc8fa@elisabeth> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: DHVGMYCEM3DMD4GLPNX2LHTAVBTHYUSE X-Message-ID-Hash: DHVGMYCEM3DMD4GLPNX2LHTAVBTHYUSE X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 2 Aug 2023 14:47:07 +1000 David Gibson wrote: > On Tue, Aug 01, 2023 at 10:15:27AM +0200, Stefano Brivio wrote: > > On Tue, 1 Aug 2023 13:36:44 +1000 > > David Gibson wrote: > > > > > As discussed on our recent calls, the C11 standard introduces > > > anonymous structure and union members and static assertions, amongst > > > other things. Both of these could be useful in a few places in > > > passt/pasta to make the code more readable and safer. > > > > > > However, at the moment, the compiler flags we use only allow C99 code. > > > This series allows C11 code, and makes some fairly obvious cleanups by > > > using it. > > > > > > It would be nice to get an opinion on this reasonably quickly, because > > > I have other patches in the works that will look different depending > > > on whether or not they can use C11 features. > > > > ...then let me start with this one, as it's straightforward: I think > > anonymous unions and structures are great. :) > > > > The series (especially 2/3) looks good to me, I'll push it in a bit. > > > > We also need to check for issues with reasonably older gcc (perhaps > > those we have in the test/distro tests, at least) and clang versions, > > unless you already did that. > > So I tried building with this series in some container images of old > debian versions. > > In buster (Debian 10), it builds ok with both gcc 8sh and clang 7ish, > although the latter unsurprisingly gives warnings for the gcc specific > __attribute__((optimize("-fno-strict-aliasing"))) we have on the > siphash functions. > > In stretch (Debian 9), it builds ok with gcc 6ish, though not with > clang-3.8ish. However the latter doesn't appear to be because of the > C11 changes - it's complaining about initializers which only list some > of the structure fields. > > In jessie (Debian 8) it doesn't build with gcc 4ish or clang-3.5ish, > but again it appears to be the incomplete initializers rather than the > C11 changes. Oops. > In short, it appears that before we hit compilers that won't cope with > the C11 changes, we hit compilers that object to incomplete > initializers that we're already using. So.. I don't think there's any > reason not to apply the C11 changes. Thanks for checking. And yes, all the "new" features used in this series should be supported starting from gcc 4.7 (March 2012) anyway, which seems to be a reasonable target. I'll go ahead and apply this. -- Stefano