build: announce requirement for C11

Message ID 20230503151413.14915-1-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series build: announce requirement for C11 |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build fail github build: failed
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Bruce Richardson May 3, 2023, 3:14 p.m. UTC
  Add a deprecation notice informing users that we will require a C11
compiler from 23.11 release onwards. This requirement was agreed by
technical board to enable use of newer C language features, e.g.
standard atomics. [1]

[1] http://inbox.dpdk.org/dev/DBAPR08MB58148CEC3E1454E8848A938998AB9@DBAPR08MB5814.eurprd08.prod.outlook.com/

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Tyler Retzlaff May 3, 2023, 3:35 p.m. UTC | #1
On Wed, May 03, 2023 at 04:14:13PM +0100, Bruce Richardson wrote:
> Add a deprecation notice informing users that we will require a C11
> compiler from 23.11 release onwards. This requirement was agreed by
> technical board to enable use of newer C language features, e.g.
> standard atomics. [1]
> 
> [1] http://inbox.dpdk.org/dev/DBAPR08MB58148CEC3E1454E8848A938998AB9@DBAPR08MB5814.eurprd08.prod.outlook.com/
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  doc/guides/rel_notes/deprecation.rst | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index dcc1ca1696..9a391d2c49 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -11,6 +11,12 @@ here.
>  Deprecation Notices
>  -------------------
>  
> +* C Compiler: From DPDK 23.11 onwards,
> +  building DPDK will require a C compiler which supports the C11 standard, or later.
> +  Please note:
> +     - C11 is supported from GCC version 5 onwards, and is the default language version in that release
> +     - C11 is the default compilation mode in Clang from version 3.6

suggest adding an additional qualification that

  C11 conformant compiler including support for optional standard atomics

  does NOT #define __STDC_NO_ATOMICS__ 1

  which requires providing the stdatomic.h header and feature. this
  shouldn't be contentious since both gcc and clang have support.
  
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

> +
>  * kvargs: The function ``rte_kvargs_process`` will get a new parameter
>    for returning key match count. It will ease handling of no-match case.
>  
> -- 
> 2.39.2
  
Bruce Richardson May 3, 2023, 3:37 p.m. UTC | #2
On Wed, May 03, 2023 at 08:35:44AM -0700, Tyler Retzlaff wrote:
> On Wed, May 03, 2023 at 04:14:13PM +0100, Bruce Richardson wrote:
> > Add a deprecation notice informing users that we will require a C11
> > compiler from 23.11 release onwards. This requirement was agreed by
> > technical board to enable use of newer C language features, e.g.
> > standard atomics. [1]
> > 
> > [1] http://inbox.dpdk.org/dev/DBAPR08MB58148CEC3E1454E8848A938998AB9@DBAPR08MB5814.eurprd08.prod.outlook.com/
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >  doc/guides/rel_notes/deprecation.rst | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> > index dcc1ca1696..9a391d2c49 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -11,6 +11,12 @@ here.
> >  Deprecation Notices
> >  -------------------
> >  
> > +* C Compiler: From DPDK 23.11 onwards,
> > +  building DPDK will require a C compiler which supports the C11 standard, or later.
> > +  Please note:
> > +     - C11 is supported from GCC version 5 onwards, and is the default language version in that release
> > +     - C11 is the default compilation mode in Clang from version 3.6
> 
> suggest adding an additional qualification that
> 
>   C11 conformant compiler including support for optional standard atomics
> 
>   does NOT #define __STDC_NO_ATOMICS__ 1
> 
>   which requires providing the stdatomic.h header and feature. this
>   shouldn't be contentious since both gcc and clang have support.
>   

Agree, that is good to clarify. I'll wait a while for more feedback and
then do a V2.

> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> 
> > +
> >  * kvargs: The function ``rte_kvargs_process`` will get a new parameter
> >    for returning key match count. It will ease handling of no-match case.
> >  
> > -- 
> > 2.39.2
  
Ferruh Yigit May 3, 2023, 3:39 p.m. UTC | #3
On 5/3/2023 4:14 PM, Bruce Richardson wrote:
> Add a deprecation notice informing users that we will require a C11
> compiler from 23.11 release onwards. This requirement was agreed by
> technical board to enable use of newer C language features, e.g.
> standard atomics. [1]
> 
> [1] http://inbox.dpdk.org/dev/DBAPR08MB58148CEC3E1454E8848A938998AB9@DBAPR08MB5814.eurprd08.prod.outlook.com/
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  doc/guides/rel_notes/deprecation.rst | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index dcc1ca1696..9a391d2c49 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -11,6 +11,12 @@ here.
>  Deprecation Notices
>  -------------------
>  
> +* C Compiler: From DPDK 23.11 onwards,
> +  building DPDK will require a C compiler which supports the C11 standard, or later.
> +  Please note:
> +     - C11 is supported from GCC version 5 onwards, and is the default language version in that release
> +     - C11 is the default compilation mode in Clang from version 3.6
> +
>  * kvargs: The function ``rte_kvargs_process`` will get a new parameter
>    for returning key match count. It will ease handling of no-match case.
>  

This only applies to DPDK internals, right?
Application linked with DPDK library won't have this requirement,
meaning DPDK public headers won't rely on C99 and C11 features.

Although this is a deprecation notice for DPDK, if above is correct,
does it make sense to highlight it to not confuse users?
  
Tyler Retzlaff May 3, 2023, 3:45 p.m. UTC | #4
On Wed, May 03, 2023 at 04:39:14PM +0100, Ferruh Yigit wrote:
> On 5/3/2023 4:14 PM, Bruce Richardson wrote:
> > Add a deprecation notice informing users that we will require a C11
> > compiler from 23.11 release onwards. This requirement was agreed by
> > technical board to enable use of newer C language features, e.g.
> > standard atomics. [1]
> > 
> > [1] http://inbox.dpdk.org/dev/DBAPR08MB58148CEC3E1454E8848A938998AB9@DBAPR08MB5814.eurprd08.prod.outlook.com/
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >  doc/guides/rel_notes/deprecation.rst | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> > index dcc1ca1696..9a391d2c49 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -11,6 +11,12 @@ here.
> >  Deprecation Notices
> >  -------------------
> >  
> > +* C Compiler: From DPDK 23.11 onwards,
> > +  building DPDK will require a C compiler which supports the C11 standard, or later.
> > +  Please note:
> > +     - C11 is supported from GCC version 5 onwards, and is the default language version in that release
> > +     - C11 is the default compilation mode in Clang from version 3.6
> > +
> >  * kvargs: The function ``rte_kvargs_process`` will get a new parameter
> >    for returning key match count. It will ease handling of no-match case.
> >  
> 
> This only applies to DPDK internals, right?
> Application linked with DPDK library won't have this requirement,
> meaning DPDK public headers won't rely on C99 and C11 features.
> 
> Although this is a deprecation notice for DPDK, if above is correct,
> does it make sense to highlight it to not confuse users?

it applies to applications as well because dpdk exposes integers
expected to be atomic via headers and inline functions use atomic
functions both internal/external.
  
Bruce Richardson May 3, 2023, 3:57 p.m. UTC | #5
On Wed, May 03, 2023 at 04:39:14PM +0100, Ferruh Yigit wrote:
> On 5/3/2023 4:14 PM, Bruce Richardson wrote:
> > Add a deprecation notice informing users that we will require a C11
> > compiler from 23.11 release onwards. This requirement was agreed by
> > technical board to enable use of newer C language features, e.g.
> > standard atomics. [1]
> > 
> > [1] http://inbox.dpdk.org/dev/DBAPR08MB58148CEC3E1454E8848A938998AB9@DBAPR08MB5814.eurprd08.prod.outlook.com/
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >  doc/guides/rel_notes/deprecation.rst | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> > index dcc1ca1696..9a391d2c49 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -11,6 +11,12 @@ here.
> >  Deprecation Notices
> >  -------------------
> >  
> > +* C Compiler: From DPDK 23.11 onwards,
> > +  building DPDK will require a C compiler which supports the C11 standard, or later.
> > +  Please note:
> > +     - C11 is supported from GCC version 5 onwards, and is the default language version in that release
> > +     - C11 is the default compilation mode in Clang from version 3.6
> > +
> >  * kvargs: The function ``rte_kvargs_process`` will get a new parameter
> >    for returning key match count. It will ease handling of no-match case.
> >  
> 
> This only applies to DPDK internals, right?
> Application linked with DPDK library won't have this requirement,
> meaning DPDK public headers won't rely on C99 and C11 features.
>
No, AFAIK, that is not correct. Originally I had thought that that would be
the case - hence the special-case tests for the headers in my previous C99
patch - but the consensus at the DPDK techboard was that we won't require
all headers to remain C89 compatible.

Originally, I was unsure about this, but now I agree with this position, on
the basis that since GCC 5, unless you have been explicitly requesting an
older standard, the compiler is using C11 rules. Therefore, everyone using
these later GCC versions is already using C11+.

/Bruce
  
Tyler Retzlaff May 3, 2023, 4:07 p.m. UTC | #6
On Wed, May 03, 2023 at 04:57:40PM +0100, Bruce Richardson wrote:
> On Wed, May 03, 2023 at 04:39:14PM +0100, Ferruh Yigit wrote:
> > On 5/3/2023 4:14 PM, Bruce Richardson wrote:
> > > Add a deprecation notice informing users that we will require a C11
> > > compiler from 23.11 release onwards. This requirement was agreed by
> > > technical board to enable use of newer C language features, e.g.
> > > standard atomics. [1]
> > > 
> > > [1] http://inbox.dpdk.org/dev/DBAPR08MB58148CEC3E1454E8848A938998AB9@DBAPR08MB5814.eurprd08.prod.outlook.com/
> > > 
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > ---
> > >  doc/guides/rel_notes/deprecation.rst | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > > 
> > > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> > > index dcc1ca1696..9a391d2c49 100644
> > > --- a/doc/guides/rel_notes/deprecation.rst
> > > +++ b/doc/guides/rel_notes/deprecation.rst
> > > @@ -11,6 +11,12 @@ here.
> > >  Deprecation Notices
> > >  -------------------
> > >  
> > > +* C Compiler: From DPDK 23.11 onwards,
> > > +  building DPDK will require a C compiler which supports the C11 standard, or later.
> > > +  Please note:
> > > +     - C11 is supported from GCC version 5 onwards, and is the default language version in that release
> > > +     - C11 is the default compilation mode in Clang from version 3.6
> > > +
> > >  * kvargs: The function ``rte_kvargs_process`` will get a new parameter
> > >    for returning key match count. It will ease handling of no-match case.
> > >  
> > 
> > This only applies to DPDK internals, right?
> > Application linked with DPDK library won't have this requirement,
> > meaning DPDK public headers won't rely on C99 and C11 features.
> >
> No, AFAIK, that is not correct. Originally I had thought that that would be
> the case - hence the special-case tests for the headers in my previous C99
> patch - but the consensus at the DPDK techboard was that we won't require
> all headers to remain C89 compatible.
> 

this is my recollection as well, everything is being aligned to C11,
which is why we are waiting for 23.11 release before the changes can
come in.

> Originally, I was unsure about this, but now I agree with this position, on
> the basis that since GCC 5, unless you have been explicitly requesting an
> older standard, the compiler is using C11 rules. Therefore, everyone using
> these later GCC versions is already using C11+.

> 
> /Bruce
  
Ferruh Yigit May 3, 2023, 4:51 p.m. UTC | #7
On 5/3/2023 4:57 PM, Bruce Richardson wrote:
> On Wed, May 03, 2023 at 04:39:14PM +0100, Ferruh Yigit wrote:
>> On 5/3/2023 4:14 PM, Bruce Richardson wrote:
>>> Add a deprecation notice informing users that we will require a C11
>>> compiler from 23.11 release onwards. This requirement was agreed by
>>> technical board to enable use of newer C language features, e.g.
>>> standard atomics. [1]
>>>
>>> [1] http://inbox.dpdk.org/dev/DBAPR08MB58148CEC3E1454E8848A938998AB9@DBAPR08MB5814.eurprd08.prod.outlook.com/
>>>
>>> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>>> ---
>>>  doc/guides/rel_notes/deprecation.rst | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
>>> index dcc1ca1696..9a391d2c49 100644
>>> --- a/doc/guides/rel_notes/deprecation.rst
>>> +++ b/doc/guides/rel_notes/deprecation.rst
>>> @@ -11,6 +11,12 @@ here.
>>>  Deprecation Notices
>>>  -------------------
>>>  
>>> +* C Compiler: From DPDK 23.11 onwards,
>>> +  building DPDK will require a C compiler which supports the C11 standard, or later.
>>> +  Please note:
>>> +     - C11 is supported from GCC version 5 onwards, and is the default language version in that release
>>> +     - C11 is the default compilation mode in Clang from version 3.6
>>> +
>>>  * kvargs: The function ``rte_kvargs_process`` will get a new parameter
>>>    for returning key match count. It will ease handling of no-match case.
>>>  
>>
>> This only applies to DPDK internals, right?
>> Application linked with DPDK library won't have this requirement,
>> meaning DPDK public headers won't rely on C99 and C11 features.
>>
> No, AFAIK, that is not correct. Originally I had thought that that would be
> the case - hence the special-case tests for the headers in my previous C99
> patch - but the consensus at the DPDK techboard was that we won't require
> all headers to remain C89 compatible.
> 

Ah, thanks for clarification. The previous patch made me think we are
keeping headers C89 compatible, I missed the final decision.

> Originally, I was unsure about this, but now I agree with this position, on
> the basis that since GCC 5, unless you have been explicitly requesting an
> older standard, the compiler is using C11 rules. Therefore, everyone using
> these later GCC versions is already using C11+.
> 

Not just compiler version, application enforcing an old standard also
may cause trouble.

But I can see this is simpler from DPDK perspective.
  
Morten Brørup May 3, 2023, 9:34 p.m. UTC | #8
> From: Bruce Richardson [mailto:bruce.richardson@intel.com]
> Sent: Wednesday, 3 May 2023 17.14
> 
> Add a deprecation notice informing users that we will require a C11
> compiler from 23.11 release onwards. This requirement was agreed by
> technical board to enable use of newer C language features, e.g.
> standard atomics. [1]
> 
> [1]
> http://inbox.dpdk.org/dev/DBAPR08MB58148CEC3E1454E8848A938998AB9@DBAPR08
> MB5814.eurprd08.prod.outlook.com/
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Acked-by: Morten Brørup <mb@smartsharesystems.com>
  

Patch

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index dcc1ca1696..9a391d2c49 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -11,6 +11,12 @@  here.
 Deprecation Notices
 -------------------
 
+* C Compiler: From DPDK 23.11 onwards,
+  building DPDK will require a C compiler which supports the C11 standard, or later.
+  Please note:
+     - C11 is supported from GCC version 5 onwards, and is the default language version in that release
+     - C11 is the default compilation mode in Clang from version 3.6
+
 * kvargs: The function ``rte_kvargs_process`` will get a new parameter
   for returning key match count. It will ease handling of no-match case.