summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2022-02-03 20:32:38 +0000
committerrillig <rillig@NetBSD.org>2022-02-03 20:32:38 +0000
commitafeb3d00e8930ff36237fcfd340007995c663728 (patch)
tree9ce0c22708817300f9df2e930f192bfe92ff23fc /tools
parent29efe8c51b71532d2268052af432f2d65021046c (diff)
tools: allow tools to use C99
The previous requirement was that tools should only use C89 features. Several tools did not follow this rule for years. Since nobody complained about not being able to build NetBSD in a C89 environment, drop that rule, now requiring C99. https://mail-index.netbsd.org/tech-toolchain/2022/01/30/msg004091.html
Diffstat (limited to 'tools')
-rw-r--r--tools/README23
1 files changed, 9 insertions, 14 deletions
diff --git a/tools/README b/tools/README
index 531a8c65c7a..4a9f0ece2bd 100644
--- a/tools/README
+++ b/tools/README
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.4 2015/01/03 13:20:11 apb Exp $
+$NetBSD: README,v 1.5 2022/02/03 20:32:38 rillig Exp $
Notes for NetBSD src/tools
@@ -29,19 +29,14 @@ Programs that are built as tools need to be more portable than other
parts of NetBSD, because they will need to run on the host platform.
Most tools should restrict themselves to C language features that are
-defined in C89 (ISO 9899-1989); they should avoid using C99 language
-features. There are a few tools, such as compilers, where it is not
-practical for the C89 restriction to be maintained. There are also a
-few features, such as the long long data type, that are used by many
-tools despite not being defined in C89.
-
-Tools may use library features such as functions, macros, and
-types, that are defined in C89 and in POSIX (IEEE Std 1003.1) (XXX
-year?), and features that are provided by the compatibility framework
-(src/tools/compat) described in a separate section below. This is
-usually not an onerous burden, because many C99 library features, and
-NetBSD-specific features, are already provided by src/tools/compat, or
-can be added when the need for them becomes apparent.
+defined in C99 (ISO/IEC 9899-1999); they should avoid using C11 language
+features, such as <threads.h>, _Alignof, <uchar.h>, _Generic,
+static_assert, anonymous structures and unions.
+
+Tools may use library features such as functions, macros, and types,
+that are defined in C99 and in POSIX (IEEE Std 1003.1) (XXX year?), and
+features that are provided by the compatibility framework
+(src/tools/compat) described in a separate section below.
If a tool attempts to use a feature that is not available on the host
platform, then the tools build will fail. This can be addressed by