git: 6d59c062d824 - main - cdefs.h: Retire __const and __signed
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 06 Jul 2024 16:03:04 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=6d59c062d8245a68e80b3a0bb2924ab49ab7dd49
commit 6d59c062d8245a68e80b3a0bb2924ab49ab7dd49
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-07-06 16:02:25 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-07-06 16:02:25 +0000
cdefs.h: Retire __const and __signed
These are no longer used in the base system. Once upon a time they were
used to ease the transition from K&R to ANSI C. These days, we use both
of these keywords in their bare form everywhere, even in our
headers. Any uses of __const or __signed will be converted to their ANSI
meaning in the compiler, but is beyond the scope of cdefs.h's
charter. For pure K&R compilation, with an enforced only use K&R
features and meanings, one needs to define NO_ANSI_KEYWORDS (though even
that support is wobbly at best, being active only for !GCC or
gcc-adjacent compilers which currently appears to be none).
Sponsored by: Netflix
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D45860
---
sys/sys/cdefs.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index b92992c1b5c3..e08da15e1d91 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -124,8 +124,6 @@
#define __STRING(x) #x /* stringify without expanding x */
#define __XSTRING(x) __STRING(x) /* expand x, then stringify */
-#define __const const /* define reserved names to standard */
-#define __signed signed
#define __volatile volatile
#if defined(__cplusplus)
#define __inline inline /* convert to C++ keyword */
@@ -141,9 +139,7 @@
#define __STRING(x) "x"
#if !defined(__CC_SUPPORTS___INLINE)
-#define __const /* delete pseudo-ANSI C keywords */
#define __inline
-#define __signed
#define __volatile
/*
* In non-ANSI C environments, new programs will want ANSI-only C keywords