This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=1b08218a3bbf3b9763ea6e0f69f4473f9f474ec2 commit 1b08218a3bbf3b9763ea6e0f69f4473f9f474ec2 Author: Guillem Jover <[email protected]> AuthorDate: Fri Dec 2 23:02:16 2022 +0100 doc: Clarify required C/C++ standards Fold both into the same subsection, and refactor how these are checked and can be relied on. Switch the C baseline from C89 plus extensions to C99 except specific features. --- README | 2 +- doc/coding-style.txt | 31 +++++++++++-------------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/README b/README index e791ef5a6..a0aa718c3 100644 --- a/README +++ b/README @@ -76,7 +76,7 @@ Building from tar source The minimum software required to configure and build dpkg from a tarball is: - C89 compiler with few C99 extensions (see doc/coding-style.txt) + C99 compiler (see doc/coding-style.txt) perl (see doc/coding-style.txt) pkg-config GNU make diff --git a/doc/coding-style.txt b/doc/coding-style.txt index 0636ee3b7..a1259a64d 100644 --- a/doc/coding-style.txt +++ b/doc/coding-style.txt @@ -71,31 +71,22 @@ or the output will get messed up. Dpkg C/C++ coding style 2016-01-29 ======================= -C language extensions -~~~~~~~~~~~~~~~~~~~~~ +Standards +~~~~~~~~~ -The code base assumes C89 plus the following C99 extensions: +The C code base assumes C99, except for the following features: - * Designated initializers. - * Compound literals. - * Trailing comma in enum. - * Variadic macros. - * Working bool type in <stdbool.h>. - * Working %j and %z printf modifiers. - * Magic __func__ variable. + - Variable length arrays. + - Mixed declaration and code. -Those are checked at build time, and it will abort in case a needed extension -is not supported. +The C++ code base assumes C++03, plus the following C++11 extension: -C++ language extensions -~~~~~~~~~~~~~~~~~~~~~~~ - -The code base assumes C++03 plus the following C++11 extension: - - * Null pointer keyword (nullptr). + + Null pointer keyword (nullptr). -This is checked at build time, and it will use compatibility code in case the -needed extension is not supported. +The required features are checked at build time, and it will either use +compatibility code in case the needed extensions are not supported and it +is possible to support them, otherwise it will abort in case a needed one +cannot be used. General ~~~~~~~ -- Dpkg.Org's dpkg

