On Wed, Feb 22, 2023 at 10:53:44AM -0800, Tyler Retzlaff wrote: > On Thu, Jan 12, 2023 at 11:35:55AM +0000, Bruce Richardson wrote: > > Traditionally, DPDK has never specified a minimum C standard used either > > in DPDK builds or for applications using DPDK. Following discussion > > on-list about C standards, this RFC attempts to start the process of > > codifying what our standards expectations are. No code changes are made > > by this RFC, instead only the build parameters are changed to explicitly > > specify: > > > > * C99 standard is used to build DPDK itself. This is supported by all > > supported compiler versions of GCC and Clang. > > * The headers are checked for compatibility with gcc89 standard, which > > was the default standard used by the oldest supported version of GCC. > > DPDK headers do not build with the official C89 standard, and, to the > > best of my knowledge, have never done so. > > subject to the technical board meeting 2023/02/22 in relation to atomics > and adoption of C11 starting in 23.11 does anything stop us from > conditionally enabling/defaulting -std=C11 for all platforms immediately > except for RHEL/CentOS 7? > > so long as we don't actually start using C11 features we should be able > to do this? or would we be worried that C11 feature use would creep in? > > just curious. > Actually, if we don't do anything, the versions of gcc (and clang AFAIK) already default to C11 or later from GCC 5 onwards. If we were to specify a version, I think it would have to be gnu11 as we may still be using some GCC extensions. However, feel free to do up a patch for c11 if it works. The change to the header checks probably don't need to be included, only a change to the default options in the top-level meson.build file.
Incidentally, even though it is missing support for the c11 atomics, gcc 4.8.5 on RHEL 7 does have the -std=c11 flag that can be used, so adding that shouldn't break anything. /Bruce