diff options
author | Mike Yuan <me@yhndnzj.com> | 2025-01-16 18:50:54 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2025-01-17 20:46:37 +0100 |
commit | 9cd064aa9ffe8728961859a127c18054c857a5b8 (patch) | |
tree | 430074aaa89ff246c3f8b70667016da8a5a979fb /docs/CODING_STYLE.md | |
parent | hexdump: if size is SIZE_MAX, use strlen() (diff) | |
download | systemd-9cd064aa9ffe8728961859a127c18054c857a5b8.tar.xz systemd-9cd064aa9ffe8728961859a127c18054c857a5b8.zip |
meson: bump C std to gnu17
GCC 8.4 (our baseline) defaults to gnu17 already.
Diffstat (limited to 'docs/CODING_STYLE.md')
-rw-r--r-- | docs/CODING_STYLE.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/CODING_STYLE.md b/docs/CODING_STYLE.md index 48fa4b093d..b8b420c142 100644 --- a/docs/CODING_STYLE.md +++ b/docs/CODING_STYLE.md @@ -151,16 +151,16 @@ SPDX-License-Identifier: LGPL-2.1-or-later ## Code Organization and Semantics -- For our codebase we intend to use ISO C11 *with* GNU extensions (aka - "gnu11"). Public APIs (i.e. those we expose via `libsystemd.so` +- For our codebase we intend to use ISO C17 *with* GNU extensions (aka + "gnu17"). Public APIs (i.e. those we expose via `libsystemd.so` i.e. `systemd/sd-*.h`) should only use ISO C89 however (with a very limited set of conservative and common extensions, such as fixed size integer types - from `<inttypes.h>`), so that we don't force consuming programs into C11 + from `<inttypes.h>`), so that we don't force consuming programs into C17 mode. (This discrepancy in particular means one thing: internally we use C99 `bool` booleans, externally C89-compatible `int` booleans which generally have different size in memory and slightly different semantics, also see below.) Both for internal and external code it's OK to use even newer - features and GCC extension than "gnu11", as long as there's reasonable + features and GCC extension than "gnu17", as long as there's reasonable fallback #ifdeffery in place to ensure compatibility is retained with older compilers. |