> From: Tyler Retzlaff [mailto:roret...@linux.microsoft.com] > Sent: Thursday, 17 February 2022 08.42 > > On Wed, Feb 16, 2022 at 10:10:01AM +0000, Bruce Richardson wrote: > > On Wed, Feb 16, 2022 at 11:05:09AM +0100, Morten Brørup wrote: > > > > From: Bruce Richardson [mailto:bruce.richard...@intel.com] > > > > Sent: Wednesday, 16 February 2022 10.33 > > > > > > > > On Tue, Feb 15, 2022 at 03:00:56PM -0800, Stephen Hemminger > wrote: > > > > > Yet another case of applying Linux kernel best practices > > > > > to DPDK. Flexible arrays are supported by Clang, GCC and > > > > > Microsoft compilers (part of C99). > > > > > > > > > Do we need to start explicitly stating that DPDK uses C99 > features, and > > > > adding -std=c99 to our build flags? Are we also requiring that > > > > applications > > > > are compiled with c99 features to use this (I would hope that > they are, > > > > but > > > > I'm not sure we can mandate it). > > > > > > No to -std=c99. It's >= C99 for applications; we should not prevent > them from using a newer C standard. > > > > Yes. For build flags, I was referring only to having it in the cflags > for the > > build of DPDK itself, not for apps. We definitely need to minimise > the > > build flags we expose to apps. > > > > > > > > Adding a note about the C standard version to the DPDK requirements > > > documentation would be very nice. It only mentions a certain > compiler > > > version required. But I think that documenting the detailed build > and > > > runtime requirements (and why they are that way) is another task. > > > > > Sure, we should do that. I am just wanting to be sure that if we > specify a > > minimum of C99, we won't get complaints back from those with legacy > > codebasees which only support C89/C90. I am therefore wondering if we > need > > to have our public headers C90-compliant? > > this seems to be the real question. what "minimum" C standard should be > documented as required to consume dpdk. we can obviously use any > standard > we wish to build/provide binaries. similarly we ought to document a > minimum C++ standard for consumption. > > i would advocate for C99 however before setting that in stone it is > fair > to ask if there are any consumers using < C99. > > we may also want to consider that the minimum required may differ > depending on the platform/port. though most differences in public > interface > i would hope could be trivially abstracted though. > > ty
Just read that the Linux kernel is moving towards C11, or at minimum C99, for version 5.18: https://lwn.net/SubscriberLink/885941/01fdc39df2ecc25f/ Let's be bold and push for the same for DPDK! :-) -Morten