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
This commit is contained in:
rillig 2022-02-03 20:32:38 +00:00
parent acb96cceeb
commit c153636995
2 changed files with 10 additions and 14 deletions

View File

@ -1,4 +1,4 @@
# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2858 $>
# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2859 $>
#
#
# [Note: This file does not mention every change made to the NetBSD source tree.
@ -468,3 +468,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
sysinst(8): Allow configuring IEEE 802.11 / Wi-Fi devices with
WPA or open networks. [nia 20220111]
tmux(1): Imported 3.2a. [christos 20220123]
tools: Allow tools to use C99. [rillig 20220203]

View File

@ -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.
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 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.
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