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 12E525A026D for ; Tue, 1 Aug 2023 05:36:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1690861010; bh=OT8PeibEhK/AIekN8fzPgWDk0/zij0K5ItX0o62nKOU=; h=From:To:Cc:Subject:Date:From; b=JMOlalOksZQnHngne/Ndnz/ic+1oYOrA4hvQbPPfEKbiMnhGbavh4r/qfYlXRM9mY MD2vT1CUQfrOZ7rwVeQWVRl4P6EV5kwM0iRz2VmF9Ts5C4yEkIgXTKzG/PfdZLUUyp X3J4P1HXHNHxRd/kU4H9STW1m3W5q5OPaTHw2zpQ= Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4RFLPt1lGLz4wyC; Tue, 1 Aug 2023 13:36:50 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 0/3] RFC: Allow C11 extensions in the passt/pasta code Date: Tue, 1 Aug 2023 13:36:44 +1000 Message-ID: <20230801033647.2135844-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.41.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 6CMIJXZA2PNBG6FIJK23OHGVP65TAV6M X-Message-ID-Hash: 6CMIJXZA2PNBG6FIJK23OHGVP65TAV6M 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: David Gibson 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: 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. David Gibson (3): Allow C11 code, not just C99 code Use C11 anonymous members to make poll refs less verbose to use Use static assertion to verify that union epoll_ref is the right size Makefile | 4 ++-- icmp.c | 22 +++++++++++----------- icmp.h | 2 +- passt.c | 8 ++++---- passt.h | 8 ++++++-- tcp.c | 46 +++++++++++++++++++++++----------------------- tcp.h | 2 +- tcp_splice.c | 11 +++++------ udp.c | 50 +++++++++++++++++++++++--------------------------- udp.h | 2 +- util.c | 4 ++-- 11 files changed, 79 insertions(+), 80 deletions(-) -- 2.41.0