Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src tools: allow tools to use C99



details:   https://anonhg.NetBSD.org/src/rev/44e28095b42b
branches:  trunk
changeset: 359965:44e28095b42b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Feb 03 20:32:38 2022 +0000

description:
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:

 doc/CHANGES  |   3 ++-
 tools/README |  21 ++++++++-------------
 2 files changed, 10 insertions(+), 14 deletions(-)

diffs (50 lines):

diff -r f841c9d654c6 -r 44e28095b42b doc/CHANGES
--- a/doc/CHANGES       Thu Feb 03 17:23:50 2022 +0000
+++ b/doc/CHANGES       Thu Feb 03 20:32:38 2022 +0000
@@ -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 @@
        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]
diff -r f841c9d654c6 -r 44e28095b42b tools/README
--- a/tools/README      Thu Feb 03 17:23:50 2022 +0000
+++ b/tools/README      Thu Feb 03 20:32:38 2022 +0000
@@ -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 @@
 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



Home | Main Index | Thread Index | Old Index