git: 9a04df0515c9 - main - cdefs.h: Remove NO_ANSI_KEYWORDS

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sat, 06 Jul 2024 16:03:05 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=9a04df0515c9bdc21cc26b31b0cdba14c0e12584

commit 9a04df0515c9bdc21cc26b31b0cdba14c0e12584
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-07-06 16:02:35 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-07-06 16:02:35 +0000

    cdefs.h: Remove NO_ANSI_KEYWORDS
    
    Remove very old, deletion of ANSI keywords. Once upon a time, it was
    common to want to do this. Then we only did it for non gcc compilers,
    then all compilers claimed to be gcc, so we never did it. These days,
    it's about useless to keep around since there's no compilers we can test
    it with. It's an odd little artifact. Also, the advice in the comment is
    wrong: if you define NO_ANSI_KEYWORDS, you can't have progams that use
    const, etc as identifiers because they will be deleted. Further, our
    header files have the 'bare' ANSI forms of these, so it's a catch 22:
    You'd need them deleted for .h files, but not for the code. It's such a
    niche case these days that it's best to just remove it.
    
    Sponsored by:           Netflix
    Reviewed by:            brooks
    Differential Revision:  https://reviews.freebsd.org/D45861
---
 sys/sys/cdefs.h | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index e08da15e1d91..b8908138bd65 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -137,24 +137,10 @@
 #define	__P(protos)	()		/* traditional C preprocessor */
 #define	__CONCAT(x,y)	x/**/y
 #define	__STRING(x)	"x"
-
 #if !defined(__CC_SUPPORTS___INLINE)
+/* Just delete these in a K&R environment */
 #define	__inline
 #define	__volatile
-/*
- * In non-ANSI C environments, new programs will want ANSI-only C keywords
- * deleted from the program and old programs will want them left alone.
- * When using a compiler other than gcc, programs using the ANSI C keywords
- * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
- * When using "gcc -traditional", we assume that this is the intent; if
- * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
- */
-#ifndef	NO_ANSI_KEYWORDS
-#define	const				/* delete ANSI C keywords */
-#define	inline
-#define	signed
-#define	volatile
-#endif	/* !NO_ANSI_KEYWORDS */
 #endif	/* !__CC_SUPPORTS___INLINE */
 #endif	/* !(__STDC__ || __cplusplus) */