Module Name: src
Committed By: rillig
Date: Fri Oct 8 23:40:08 UTC 2021
Modified Files:
src/tests/usr.bin/indent: opt-ldi.0 opt-ldi.0.stdout
src/usr.bin/indent: lexi.c
Log Message:
indent: remove 'global' from the list of keywords
Since 1978, 'global' has not been a keyword in C. Moreover, it was
declared as a type while its name would rather suggest a storage class.
Removing the keyword fixes the formatting of variables named 'global'.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/opt-ldi.0 \
src/tests/usr.bin/indent/opt-ldi.0.stdout
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/indent/lexi.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/indent/opt-ldi.0
diff -u src/tests/usr.bin/indent/opt-ldi.0:1.2 src/tests/usr.bin/indent/opt-ldi.0:1.3
--- src/tests/usr.bin/indent/opt-ldi.0:1.2 Sat Mar 6 22:10:40 2021
+++ src/tests/usr.bin/indent/opt-ldi.0 Fri Oct 8 23:40:08 2021
@@ -1,7 +1,6 @@
-/* $NetBSD: opt-ldi.0,v 1.2 2021/03/06 22:10:40 rillig Exp $ */
+/* $NetBSD: opt-ldi.0,v 1.3 2021/10/08 23:40:08 rillig Exp $ */
/* $FreeBSD$ */
-/* FIXME: Why does -ldi affect global variables? */
int global;
void
Index: src/tests/usr.bin/indent/opt-ldi.0.stdout
diff -u src/tests/usr.bin/indent/opt-ldi.0.stdout:1.2 src/tests/usr.bin/indent/opt-ldi.0.stdout:1.3
--- src/tests/usr.bin/indent/opt-ldi.0.stdout:1.2 Sat Mar 6 22:10:40 2021
+++ src/tests/usr.bin/indent/opt-ldi.0.stdout Fri Oct 8 23:40:08 2021
@@ -1,8 +1,7 @@
-/* $NetBSD: opt-ldi.0.stdout,v 1.2 2021/03/06 22:10:40 rillig Exp $ */
+/* $NetBSD: opt-ldi.0.stdout,v 1.3 2021/10/08 23:40:08 rillig Exp $ */
/* $FreeBSD$ */
-/* FIXME: Why does -ldi affect global variables? */
-int global;
+int global;
void
function(void)
Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.84 src/usr.bin/indent/lexi.c:1.85
--- src/usr.bin/indent/lexi.c:1.84 Fri Oct 8 21:24:40 2021
+++ src/usr.bin/indent/lexi.c Fri Oct 8 23:40:08 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lexi.c,v 1.84 2021/10/08 21:24:40 rillig Exp $ */
+/* $NetBSD: lexi.c,v 1.85 2021/10/08 23:40:08 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c 8.1 (
#include <sys/cdefs.h>
#if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.84 2021/10/08 21:24:40 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.85 2021/10/08 23:40:08 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
#endif
@@ -81,7 +81,6 @@ static const struct keyword {
{"extern", kw_storage_class},
{"float", kw_type},
{"for", kw_for_or_if_or_while},
- {"global", kw_type},
{"goto", kw_jump},
{"if", kw_for_or_if_or_while},
{"imaginary", kw_type},