From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id EB7DE5A026D for ; Wed, 2 Aug 2023 06:47:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1690951656; bh=c9hMBIBs/9EJwAfJGe9U+sUk4omocB29bGLOUomZflc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=moMjXScRb5fplO1r7y0qdys1n/yB3KNyeJRDLDJuDAvA7g5elWCU7H9digRB1J9ls 670JdQDcQxOUUm7FnWfjr6lP1PvElnHMSlSutMVGNHKrHYGupTfYvpUsBsLZT8nuXS 1PpfTGjBnT53vBH4AksQg6W3wKA5gjLvL72skwWI= Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4RFzx40n07z4yMj; Wed, 2 Aug 2023 14:47:36 +1000 (AEST) Date: Wed, 2 Aug 2023 14:47:07 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 0/3] RFC: Allow C11 extensions in the passt/pasta code Message-ID: References: <20230801033647.2135844-1-david@gibson.dropbear.id.au> <20230801101527.6cbdc8fa@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rhi0xdYYRkWtKq8f" Content-Disposition: inline In-Reply-To: <20230801101527.6cbdc8fa@elisabeth> Message-ID-Hash: XBBSN45MMLIOCHB6OBJHTYDIWKTP63MS X-Message-ID-Hash: XBBSN45MMLIOCHB6OBJHTYDIWKTP63MS X-MailFrom: dgibson@gandalf.ozlabs.org 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: --rhi0xdYYRkWtKq8f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: >=20 > > 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. > >=20 > > 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. > >=20 > > 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. >=20 > ...then let me start with this one, as it's straightforward: I think > anonymous unions and structures are great. :) >=20 > The series (especially 2/3) looks good to me, I'll push it in a bit. >=20 > 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. 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. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --rhi0xdYYRkWtKq8f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmTJ37IACgkQzQJF27ox 2GcncRAAkTnjsETMQ5W/3vh1dD3MzL1lpGlDlBbigHhEb9a8IB9VxdHjzXVlw1+V 04+mTE41cQOaLA/r5BQGx+zI+5yHP7VNaP1wQfn84SDrjyB1BvgobQxPmudPBoSu i+xliMll3GnxLmPrrs8qTKPhtLnQl/bINzi0v0UbAtWW1bzyS3K9D4Q9sXY2h3dK /3Hj2O2YDs7SahNquEUL9wKF8mJqLWXsZEHtnQUzGeB21aznKAnvGYV0wul3oSzA 0suJ59mO4wWl9tZV4LYlf1R8RBvfJL6D1GpOMdMRC92V0DSDR9cXyP9Af6j4VbIK BLoAys4NHDTvWADukGnvjIvRxTCDaZP/l3fwv/I49x2zsvF+riGFUbTQqP5Ph1km WYSOPkhCgLlxpct6cuA0lOU5yUqsW+cZzdS6DrTWr04WfsKSSQS24jz5iE7w/sSn DFyal//xZxs6hyBaKzYUfgZT/OeykFdCH56bseIFWOmEGRKW22xYHwPCa80JLXub VyfDboKgE+K0KnDg+OcKHcOdnWoKpzq8/Pk4qSJU6KwZcl3qDjSrqob5LCKQbn0x ie66OPMCPPuOV7IC8hKXUCsxcBAikF5enkG6kJ/QLs4DXwG5lUfXxWy+aktOEWVU EjXiNlJRQ8qayOERBnWby29T4eloiJCguqXyirdsjTJoU85w/OM= =IlgM -----END PGP SIGNATURE----- --rhi0xdYYRkWtKq8f--