CVS commit: src/usr.bin/xlint/lint1

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 22:48:49 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: op.h

Log Message:
lint: reduce pointer dereferences and relocations

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/xlint/lint1/op.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/op.h
diff -u src/usr.bin/xlint/lint1/op.h:1.24 src/usr.bin/xlint/lint1/op.h:1.25
--- src/usr.bin/xlint/lint1/op.h:1.24	Thu Sep 14 22:20:08 2023
+++ src/usr.bin/xlint/lint1/op.h	Thu Sep 14 22:48:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: op.h,v 1.24 2023/09/14 22:20:08 rillig Exp $	*/
+/*	$NetBSD: op.h,v 1.25 2023/09/14 22:48:49 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -57,7 +57,7 @@ typedef	struct {
 	bool	m_bad_on_enum: 1;
 	bool	m_warn_if_operand_eq: 1;
 	bool	m_has_operands: 1;
-	const char *m_name;
+	const char m_name[8];
 } mod_t;
 
 typedef enum {



CVS commit: src/usr.bin/xlint/lint1

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 22:48:49 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: op.h

Log Message:
lint: reduce pointer dereferences and relocations

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/xlint/lint1/op.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/xlint/lint1

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 22:20:09 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: cgram.y op.h oper.c scan.l

Log Message:
lint: remove pseudo operators INC and DEC

These operators were not used in expressions, they were only used as
additional token info.  Use a plain bool instead.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.473 -r1.474 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/xlint/lint1/op.h
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/lint1/oper.c
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/xlint/lint1/scan.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/xlint/lint1

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 22:20:09 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: cgram.y op.h oper.c scan.l

Log Message:
lint: remove pseudo operators INC and DEC

These operators were not used in expressions, they were only used as
additional token info.  Use a plain bool instead.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.473 -r1.474 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/xlint/lint1/op.h
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/lint1/oper.c
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/xlint/lint1/scan.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.473 src/usr.bin/xlint/lint1/cgram.y:1.474
--- src/usr.bin/xlint/lint1/cgram.y:1.473	Thu Sep 14 21:53:02 2023
+++ src/usr.bin/xlint/lint1/cgram.y	Thu Sep 14 22:20:08 2023
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.473 2023/09/14 21:53:02 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.474 2023/09/14 22:20:08 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: cgram.y,v 1.473 2023/09/14 21:53:02 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.474 2023/09/14 22:20:08 rillig Exp $");
 #endif
 
 #include 
@@ -138,6 +138,7 @@ is_either(const char *s, const char *a, 
 	val_t	*y_val;
 	sbuf_t	*y_name;
 	sym_t	*y_sym;
+	bool	y_inc;
 	op_t	y_op;
 	scl_t	y_scl;
 	tspec_t	y_tspec;
@@ -168,6 +169,7 @@ is_either(const char *s, const char *a, 
 	debug_sym("", $$, "");
 	debug_pop_indented(indented);
 } 
+%printer { fprintf(yyo, "%s", $$ ? "++" : "--"); } 
 %printer { fprintf(yyo, "%s", op_name($$)); } 
 %printer { fprintf(yyo, "%s", scl_name($$)); } 
 %printer { fprintf(yyo, "%s", tspec_name($$)); } 
@@ -197,7 +199,7 @@ is_either(const char *s, const char *a, 
 %token			T_LBRACE T_RBRACE T_LBRACK T_RBRACK T_LPAREN T_RPAREN
 %token			T_POINT T_ARROW
 %token			T_COMPLEMENT T_LOGNOT
-%token			T_INCDEC
+%token			T_INCDEC
 %token			T_SIZEOF
 %token			T_BUILTIN_OFFSETOF
 %token			T_TYPEOF
@@ -551,7 +553,7 @@ postfix_expression:
 		$$ = build_member_access($1, $2, $3, $4);
 	}
 |	postfix_expression T_INCDEC sys {
-		$$ = build_unary($2 == INC ? INCAFT : DECAFT, $3, $1);
+		$$ = build_unary($2 ? INCAFT : DECAFT, $3, $1);
 	}
 |	T_LPAREN type_name T_RPAREN {	/* C99 6.5.2.5 "Compound literals" */
 		sym_t *tmp = mktempsym($2);
@@ -643,7 +645,7 @@ argument_expression_list:
 unary_expression:
 	postfix_expression
 |	T_INCDEC sys unary_expression {
-		$$ = build_unary($1 == INC ? INCBEF : DECBEF, $2, $3);
+		$$ = build_unary($1 ? INCBEF : DECBEF, $2, $3);
 	}
 |	T_AMPER sys cast_expression {
 		$$ = build_unary(ADDR, $2, $3);
@@ -2244,6 +2246,7 @@ cgram_to_string(int token, YYSTYPE val)
 
 	switch (token) {
 	case T_INCDEC:
+		return val.y_inc ? "++" : "--";
 	case T_MULTIPLICATIVE:
 	case T_ADDITIVE:
 	case T_SHIFT:

Index: src/usr.bin/xlint/lint1/op.h
diff -u src/usr.bin/xlint/lint1/op.h:1.23 src/usr.bin/xlint/lint1/op.h:1.24
--- src/usr.bin/xlint/lint1/op.h:1.23	Thu Sep 14 21:08:12 2023
+++ src/usr.bin/xlint/lint1/op.h	Thu Sep 14 22:20:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: op.h,v 1.23 2023/09/14 21:08:12 rillig Exp $	*/
+/*	$NetBSD: op.h,v 1.24 2023/09/14 22:20:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -66,8 +66,6 @@ typedef enum {
 	POINT,
 	NOT,
 	COMPL,
-	INC,			/* does not appear in the tree */
-	DEC,			/* does not appear in the tree */
 	INCBEF,
 	DECBEF,
 	INCAFT,

Index: src/usr.bin/xlint/lint1/oper.c
diff -u src/usr.bin/xlint/lint1/oper.c:1.13 src/usr.bin/xlint/lint1/oper.c:1.14
--- src/usr.bin/xlint/lint1/oper.c:1.13	Thu Sep 14 21:08:12 2023
+++ src/usr.bin/xlint/lint1/oper.c	Thu Sep 14 22:20:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: oper.c,v 1.13 2023/09/14 21:08:12 rillig Exp $	*/
+/*	$NetBSD: oper.c,v 1.14 2023/09/14 22:20:08 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -68,8 +68,6 @@ const mod_t modtab[NOPS] = {
 	{X,_,X,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,X, "." },
 	{_,X,X,X,_,_,_,X,X,_,_,_,_,_,_,_,_,X,_,X, "!" },
 	{_,_,_,_,_,X,_,_,X,X,_,_,_,_,_,_,_,X,X,X, "~" },
-	{_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,X, "++" },
-	{_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,X, "--" },
 	/*
 	 * The '++' and '--' operators are conceptually unary operators, but
 	 * lint implements them as binary operators due to the pre-multiplied

Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.139 src/usr.bin/xlint/lint1/scan.l:1.140
--- src/usr.bin/xlint/lint1/scan.l:1.139	Thu Jul 13 08:40:38 2023
+++ src/usr.bin/xlint/lint1/scan.l	Thu Sep 14 22:20:08 2023
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.139 2023/07/13 08:40:38 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.140 2023/09/14 22:20:08 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 

CVS commit: src

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 21:53:02 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_039.c msg_047.c msg_322.c msg_343.c
src/usr.bin/xlint/lint1: cgram.y decl.c err.c

Log Message:
lint: fix wording of diagnostics about 'C99 extension'

The term 'extension' means an extension to a C standard.  C99 by itself
is not an extension but a revision of the C standard.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_039.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_047.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_322.c
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/msg_343.c
cvs rdiff -u -r1.472 -r1.473 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.378 -r1.379 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.217 -r1.218 src/usr.bin/xlint/lint1/err.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/xlint/lint1/msg_039.c
diff -u src/tests/usr.bin/xlint/lint1/msg_039.c:1.4 src/tests/usr.bin/xlint/lint1/msg_039.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_039.c:1.4	Mon Jun 20 21:13:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_039.c	Thu Sep 14 21:53:02 2023
@@ -1,13 +1,13 @@
-/*	$NetBSD: msg_039.c,v 1.4 2022/06/20 21:13:36 rillig Exp $	*/
+/*	$NetBSD: msg_039.c,v 1.5 2023/09/14 21:53:02 rillig Exp $	*/
 # 3 "msg_039.c"
 
-/* Test for message: zero-sized array '%s' in struct is a C99 extension [39] */
+/* Test for message: zero-sized array '%s' in struct requires C99 or later [39] */
 
 /* lint1-flags: -w */
 
 struct s {
-	/* expect+2: warning: zero sized array is a C99 extension [322] */
-	/* expect+1: warning: zero-sized array 'member' in struct is a C99 extension [39] */
+	/* expect+2: warning: zero sized array requires C99 or later [322] */
+	/* expect+1: warning: zero-sized array 'member' in struct requires C99 or later [39] */
 	char member[0];
 	char member2;
 };

Index: src/tests/usr.bin/xlint/lint1/msg_047.c
diff -u src/tests/usr.bin/xlint/lint1/msg_047.c:1.5 src/tests/usr.bin/xlint/lint1/msg_047.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_047.c:1.5	Mon Jun 20 21:13:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_047.c	Thu Sep 14 21:53:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_047.c,v 1.5 2022/06/20 21:13:36 rillig Exp $	*/
+/*	$NetBSD: msg_047.c,v 1.6 2023/09/14 21:53:02 rillig Exp $	*/
 # 3 "msg_047.c"
 
 /* Test for message: zero sized %s is a C99 feature [47] */
@@ -11,8 +11,8 @@ struct empty {
 /* expect-1: error: zero sized struct is a C99 feature [47] */
 
 struct zero_sized {
-	/* expect+2: error: zero sized array is a C99 extension [322] */
-	/* expect+1: error: zero-sized array 'dummy' in struct is a C99 extension [39] */
+	/* expect+2: error: zero sized array requires C99 or later [322] */
+	/* expect+1: error: zero-sized array 'dummy' in struct requires C99 or later [39] */
 	char dummy[0];
 };
 /* expect-1: error: zero sized struct is a C99 feature [47] */

Index: src/tests/usr.bin/xlint/lint1/msg_322.c
diff -u src/tests/usr.bin/xlint/lint1/msg_322.c:1.3 src/tests/usr.bin/xlint/lint1/msg_322.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_322.c:1.3	Fri Jun 17 06:59:16 2022
+++ src/tests/usr.bin/xlint/lint1/msg_322.c	Thu Sep 14 21:53:02 2023
@@ -1,9 +1,9 @@
-/*	$NetBSD: msg_322.c,v 1.3 2022/06/17 06:59:16 rillig Exp $	*/
+/*	$NetBSD: msg_322.c,v 1.4 2023/09/14 21:53:02 rillig Exp $	*/
 # 3 "msg_322.c"
 
-/* Test for message: zero sized array is a C99 extension [322] */
+/* Test for message: zero sized array requires C99 or later [322] */
 
 /* lint1-flags: -sw */
 
-/* expect+1: error: zero sized array is a C99 extension [322] */
+/* expect+1: error: zero sized array requires C99 or later [322] */
 typedef int empty_array[0];

Index: src/tests/usr.bin/xlint/lint1/msg_343.c
diff -u src/tests/usr.bin/xlint/lint1/msg_343.c:1.9 src/tests/usr.bin/xlint/lint1/msg_343.c:1.10
--- src/tests/usr.bin/xlint/lint1/msg_343.c:1.9	Tue Mar 28 14:44:35 2023
+++ src/tests/usr.bin/xlint/lint1/msg_343.c	Thu Sep 14 21:53:02 2023
@@ -1,13 +1,13 @@
-/*	$NetBSD: msg_343.c,v 1.9 2023/03/28 14:44:35 rillig Exp $	*/
+/*	$NetBSD: msg_343.c,v 1.10 2023/09/14 21:53:02 rillig Exp $	*/
 # 3 "msg_343.c"
 
-/* Test for message: static array size is a C11 extension [343] */
+/* Test for message: static array size requires C11 or later [343] */
 
 /* lint1-flags: -Sw -X 351 */
 
 void takes_int_pointer(int []);
 void takes_int_pointer_with_ignored_size(int [3]);
-/* expect+1: error: static array size is a C11 extension [343] */
+/* expect+1: error: static array size requires C11 or later [343] */
 void takes_int_array(int[static 3]);
 /* expect+1: error: syntax error '3' [249] */
 void takes_volatile_int_array(int[volatile 3]);
@@ -25,7 +25,7 @@ returns_int_pointer_with_ignored_size(in
 }
 
 int
-/* expect+1: error: static array size is a C11 extension [343] */
+/* expect+1: 

CVS commit: src

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 21:53:02 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_039.c msg_047.c msg_322.c msg_343.c
src/usr.bin/xlint/lint1: cgram.y decl.c err.c

Log Message:
lint: fix wording of diagnostics about 'C99 extension'

The term 'extension' means an extension to a C standard.  C99 by itself
is not an extension but a revision of the C standard.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_039.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_047.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_322.c
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/msg_343.c
cvs rdiff -u -r1.472 -r1.473 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.378 -r1.379 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.217 -r1.218 src/usr.bin/xlint/lint1/err.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/xlint/lint1

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 21:08:12 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: README.md lint1.h op.h oper.c
Removed Files:
src/usr.bin/xlint/lint1: ops.def

Log Message:
lint: remove preprocessor magic from definition of operators

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/lint1/README.md
cvs rdiff -u -r1.201 -r1.202 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/lint1/op.h
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/xlint/lint1/oper.c
cvs rdiff -u -r1.31 -r0 src/usr.bin/xlint/lint1/ops.def

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/README.md
diff -u src/usr.bin/xlint/lint1/README.md:1.13 src/usr.bin/xlint/lint1/README.md:1.14
--- src/usr.bin/xlint/lint1/README.md:1.13	Wed Aug  2 18:51:25 2023
+++ src/usr.bin/xlint/lint1/README.md	Thu Sep 14 21:08:12 2023
@@ -1,4 +1,4 @@
-[//]: # ($NetBSD: README.md,v 1.13 2023/08/02 18:51:25 rillig Exp $)
+[//]: # ($NetBSD: README.md,v 1.14 2023/09/14 21:08:12 rillig Exp $)
 
 # Introduction
 
@@ -105,7 +105,7 @@ it needs to be copied using `block_dup_t
 When lint parses an expression,
 it builds a tree of nodes representing the AST.
 Each node has an operator that defines which other members may be accessed.
-The operators and their properties are defined in `ops.def`.
+The operators and their properties are defined in `oper.c`.
 Some examples for operators:
 
 | Operator | Meaning|

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.201 src/usr.bin/xlint/lint1/lint1.h:1.202
--- src/usr.bin/xlint/lint1/lint1.h:1.201	Wed Sep 13 20:31:58 2023
+++ src/usr.bin/xlint/lint1/lint1.h	Thu Sep 14 21:08:12 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.201 2023/09/13 20:31:58 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.202 2023/09/14 21:08:12 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -111,7 +111,7 @@ typedef struct {
 	 * Set if an integer constant is unsigned only in C90 and later, but
 	 * not in traditional C.
 	 *
-	 * See the operators table in ops.def, columns "l r".
+	 * See the operators table in oper.c, columns "l r".
 	 */
 	bool	v_unsigned_since_c90;
 	bool	v_char_constant;

Index: src/usr.bin/xlint/lint1/op.h
diff -u src/usr.bin/xlint/lint1/op.h:1.22 src/usr.bin/xlint/lint1/op.h:1.23
--- src/usr.bin/xlint/lint1/op.h:1.22	Wed Sep 13 20:31:58 2023
+++ src/usr.bin/xlint/lint1/op.h	Thu Sep 14 21:08:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: op.h,v 1.22 2023/09/13 20:31:58 rillig Exp $	*/
+/*	$NetBSD: op.h,v 1.23 2023/09/14 21:08:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -34,7 +34,7 @@
 #include 
 
 /*
- * Various information about operators; see ops.def.
+ * Various information about operators.
  */
 typedef	struct {
 	bool	m_binary: 1;
@@ -60,17 +60,87 @@ typedef	struct {
 	const char *m_name;
 } mod_t;
 
-extern const mod_t modtab[];
+typedef enum {
+	NOOP,
+	ARROW,
+	POINT,
+	NOT,
+	COMPL,
+	INC,			/* does not appear in the tree */
+	DEC,			/* does not appear in the tree */
+	INCBEF,
+	DECBEF,
+	INCAFT,
+	DECAFT,
+	UPLUS,
+	UMINUS,
+	INDIR,
+	ADDR,
 
-#define begin_ops() typedef enum {
-#define op(name, repr, \
-		is_binary, is_logical, takes_bool, requires_bool, \
-		is_integer, is_complex, is_arithmetic, is_scalar, \
-		can_fold, is_value, unused, balances_operands, \
-		side_effects, left_unsigned, right_unsigned, \
-		precedence_confusion, is_comparison, \
-		valid_on_enum, bad_on_enum, warn_if_eq, \
-		has_operands) \
-	name,
-#define end_ops() } op_t;
-#include "ops.def"
+	MULT,
+	DIV,
+	MOD,
+	PLUS,
+	MINUS,
+	SHL,
+	SHR,
+
+	LT,
+	LE,
+	GT,
+	GE,
+	EQ,
+	NE,
+
+	BITAND,
+	BITXOR,
+	BITOR,
+	LOGAND,
+	LOGOR,
+	QUEST,
+	COLON,
+
+	ASSIGN,
+	MULASS,
+	DIVASS,
+	MODASS,
+	ADDASS,
+	SUBASS,
+	SHLASS,
+	SHRASS,
+	ANDASS,
+	XORASS,
+	ORASS,
+
+	NAME,
+	CON,
+	STRING,
+	FSEL,
+	CALL,
+	COMMA,
+	CVT,
+	ICALL,
+	LOAD,
+	/*
+	 * PUSH is a virtual node that is used to concatenate arguments in a
+	 * function call expression.  The PUSH nodes are ordered from right to
+	 * left.  For example, the function call f(17, 23) is represented as
+	 * CALL(f, PUSH(23, PUSH(17, NULL))).
+	 */
+	PUSH,
+	RETURN,
+	REAL,
+	IMAG,
+
+	INIT,			/* does not appear in the tree */
+	CASE,			/* does not appear in the tree */
+	/*
+	 * FARG is only used temporarily in check_prototype_argument to check
+	 * type compatibility and conversion for function arguments.
+	 */
+	FARG,			/* does not appear in the tree */
+} op_t;
+
+#define NOPS ((int)FARG + 1)
+
+extern const mod_t modtab[NOPS];

Index: src/usr.bin/xlint/lint1/oper.c
diff -u src/usr.bin/xlint/lint1/oper.c:1.12 src/usr.bin/xlint/lint1/oper.c:1.13
--- src/usr.bin/xlint/lint1/oper.c:1.12	Wed Sep 13 20:31:58 2023
+++ 

CVS commit: src/usr.bin/xlint/lint1

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 21:08:12 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: README.md lint1.h op.h oper.c
Removed Files:
src/usr.bin/xlint/lint1: ops.def

Log Message:
lint: remove preprocessor magic from definition of operators

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/lint1/README.md
cvs rdiff -u -r1.201 -r1.202 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/lint1/op.h
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/xlint/lint1/oper.c
cvs rdiff -u -r1.31 -r0 src/usr.bin/xlint/lint1/ops.def

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/npf/npfctl

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 20:03:56 UTC 2023

Modified Files:
src/usr.sbin/npf/npfctl: Makefile

Log Message:
npfctl: remove no-op NOLINT definition

Setting NOLINT must be done before including  to have an
effect.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/npf/npfctl/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/npf/npfctl/Makefile
diff -u src/usr.sbin/npf/npfctl/Makefile:1.15 src/usr.sbin/npf/npfctl/Makefile:1.16
--- src/usr.sbin/npf/npfctl/Makefile:1.15	Sat May 30 14:16:56 2020
+++ src/usr.sbin/npf/npfctl/Makefile	Thu Sep 14 20:03:56 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2020/05/30 14:16:56 rmind Exp $
+# $NetBSD: Makefile,v 1.16 2023/09/14 20:03:56 rillig Exp $
 
 .include 
 
@@ -17,6 +17,5 @@ LDADD+=		-lnpf -lpcap -lutil -ly
 DPADD+=		${LIBNPF} ${LIBUTIL} ${LIBPCAP} ${LIBUTIL} ${LIBY}
 
 WARNS=		5
-NOLINT=		# disabled deliberately
 
 .include 



CVS commit: src/usr.sbin/npf/npfctl

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 20:03:56 UTC 2023

Modified Files:
src/usr.sbin/npf/npfctl: Makefile

Log Message:
npfctl: remove no-op NOLINT definition

Setting NOLINT must be done before including  to have an
effect.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/npf/npfctl/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl2/lvm2/sbin/lvm

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 19:54:41 UTC 2023

Modified Files:
src/external/gpl2/lvm2/sbin/lvm: Makefile

Log Message:
lvm: add rationale for disabling lint


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl2/lvm2/sbin/lvm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/sbin/lvm/Makefile
diff -u src/external/gpl2/lvm2/sbin/lvm/Makefile:1.12 src/external/gpl2/lvm2/sbin/lvm/Makefile:1.13
--- src/external/gpl2/lvm2/sbin/lvm/Makefile:1.12	Tue Jan 14 20:22:35 2014
+++ src/external/gpl2/lvm2/sbin/lvm/Makefile	Thu Sep 14 19:54:41 2023
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile,v 1.12 2014/01/14 20:22:35 christos Exp $
+#	$NetBSD: Makefile,v 1.13 2023/09/14 19:54:41 rillig Exp $
 
 USE_FORT?=	no
-NOLINT=		#defined
+NOLINT=		# reporter.c uses a '?:' operator
 CWARNFLAGS.clang+=	-Wno-parentheses
 
 .include "../../lvm2tools.mk"



CVS commit: src/external/gpl2/lvm2/sbin/lvm

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 19:54:41 UTC 2023

Modified Files:
src/external/gpl2/lvm2/sbin/lvm: Makefile

Log Message:
lvm: add rationale for disabling lint


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl2/lvm2/sbin/lvm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl2/lvm2/sbin/dmsetup

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 19:52:09 UTC 2023

Modified Files:
src/external/gpl2/lvm2/sbin/dmsetup: Makefile

Log Message:
dmsetup: add rationale for disabling lint for this program


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl2/lvm2/sbin/dmsetup/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/sbin/dmsetup/Makefile
diff -u src/external/gpl2/lvm2/sbin/dmsetup/Makefile:1.8 src/external/gpl2/lvm2/sbin/dmsetup/Makefile:1.9
--- src/external/gpl2/lvm2/sbin/dmsetup/Makefile:1.8	Thu May 26 12:56:26 2011
+++ src/external/gpl2/lvm2/sbin/dmsetup/Makefile	Thu Sep 14 19:52:09 2023
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile,v 1.8 2011/05/26 12:56:26 joerg Exp $
+#	$NetBSD: Makefile,v 1.9 2023/09/14 19:52:09 rillig Exp $
 
 USE_FORT?=	no
-NOLINT=		#defined
+NOLINT=		# dmsetup.c has a '?:' operator in line 255
 CWARNFLAGS.clang+=	-Wno-parentheses -Wno-unused-value
 
 .include "../../lvm2tools.mk"



CVS commit: src/external/gpl2/lvm2/sbin/dmsetup

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 19:52:09 UTC 2023

Modified Files:
src/external/gpl2/lvm2/sbin/dmsetup: Makefile

Log Message:
dmsetup: add rationale for disabling lint for this program


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl2/lvm2/sbin/dmsetup/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/crypto/external/bsd/heimdal/bin/verify_krb5_conf

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 19:29:52 UTC 2023

Modified Files:
src/crypto/external/bsd/heimdal/bin/verify_krb5_conf: Makefile

Log Message:
verify_krb5_conf: enable lint

There is no apparent reason to disable lint for this program.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/heimdal/bin/verify_krb5_conf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/heimdal/bin/verify_krb5_conf/Makefile
diff -u src/crypto/external/bsd/heimdal/bin/verify_krb5_conf/Makefile:1.5 src/crypto/external/bsd/heimdal/bin/verify_krb5_conf/Makefile:1.6
--- src/crypto/external/bsd/heimdal/bin/verify_krb5_conf/Makefile:1.5	Thu Jun 22 22:39:23 2023
+++ src/crypto/external/bsd/heimdal/bin/verify_krb5_conf/Makefile	Thu Sep 14 19:29:52 2023
@@ -1,9 +1,7 @@
-#	$NetBSD: Makefile,v 1.5 2023/06/22 22:39:23 christos Exp $
+#	$NetBSD: Makefile,v 1.6 2023/09/14 19:29:52 rillig Exp $
 
 WARNS?=	2	# XXX -Wextra
 
-NOLINT= # defined
-
 .include 
 .include <${.CURDIR}/../../Makefile.inc>
 



CVS commit: src/crypto/external/bsd/heimdal/bin/verify_krb5_conf

2023-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Sep 14 19:29:52 UTC 2023

Modified Files:
src/crypto/external/bsd/heimdal/bin/verify_krb5_conf: Makefile

Log Message:
verify_krb5_conf: enable lint

There is no apparent reason to disable lint for this program.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/heimdal/bin/verify_krb5_conf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/dts

2023-09-14 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Thu Sep 14 12:27:55 UTC 2023

Added Files:
src/sys/arch/arm/dts: rk3399-pinebook-pro.dts

Log Message:
Enable crypto engine on Pinebook Pro.

Only used for rng at present.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.7 src/sys/arch/arm/dts/rk3399-pinebook-pro.dts

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/arch/arm/dts/rk3399-pinebook-pro.dts
diff -u /dev/null src/sys/arch/arm/dts/rk3399-pinebook-pro.dts:1.7
--- /dev/null	Thu Sep 14 12:27:56 2023
+++ src/sys/arch/arm/dts/rk3399-pinebook-pro.dts	Thu Sep 14 12:27:55 2023
@@ -0,0 +1,30 @@
+/* $NetBSD: rk3399-pinebook-pro.dts,v 1.7 2023/09/14 12:27:55 rjs Exp $ */
+
+/*-
+ * Copyright (c) 2023 Robert Swindells 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "../../../external/gpl2/dts/dist/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts"
+#include "rk3399-crypto.dtsi"



CVS commit: src/sys/arch/arm/dts

2023-09-14 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Thu Sep 14 12:27:55 UTC 2023

Added Files:
src/sys/arch/arm/dts: rk3399-pinebook-pro.dts

Log Message:
Enable crypto engine on Pinebook Pro.

Only used for rng at present.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.7 src/sys/arch/arm/dts/rk3399-pinebook-pro.dts

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-09-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 14 08:48:29 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
ixg(4): Rename some descriptions of flow control related event conters.


To generate a diff of this commit:
cvs rdiff -u -r1.330 -r1.331 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.330 src/sys/dev/pci/ixgbe/ixgbe.c:1.331
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.330	Thu Sep 14 08:47:24 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Sep 14 08:48:29 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.330 2023/09/14 08:47:24 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.331 2023/09/14 08:48:29 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.330 2023/09/14 08:47:24 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.331 2023/09/14 08:48:29 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1860,21 +1860,21 @@ ixgbe_add_hw_stats(struct adapter *adapt
 		if (i < __arraycount(stats->pxontxc)) {
 			evcnt_attach_dynamic(>pxontxc[i],
 			EVCNT_TYPE_MISC, NULL, adapter->tcs[i].evnamebuf,
-			"pxontxc");
+			"Priority XON Transmitted");
 			evcnt_attach_dynamic(>pxofftxc[i],
 			EVCNT_TYPE_MISC, NULL, adapter->tcs[i].evnamebuf,
-			"pxofftxc");
+			"Priority XOFF Transmitted");
 			if (hw->mac.type >= ixgbe_mac_82599EB)
 evcnt_attach_dynamic(>pxon2offc[i],
 EVCNT_TYPE_MISC, NULL,
 adapter->tcs[i].evnamebuf,
-"pxon2offc");
+"Priority XON to XOFF");
 			evcnt_attach_dynamic(>pxonrxc[i],
 			EVCNT_TYPE_MISC, NULL, adapter->tcs[i].evnamebuf,
-			"pxonrxc");
+			"Priority XON Received");
 			evcnt_attach_dynamic(>pxoffrxc[i],
 			EVCNT_TYPE_MISC, NULL, adapter->tcs[i].evnamebuf,
-			"pxoffrxc");
+			"Priority XOFF Received");
 		}
 	}
 



CVS commit: src/sys/dev/pci/ixgbe

2023-09-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 14 08:48:29 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
ixg(4): Rename some descriptions of flow control related event conters.


To generate a diff of this commit:
cvs rdiff -u -r1.330 -r1.331 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-09-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 14 08:47:24 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
ixg(4): Reorder some flow control related event counters for readability.


To generate a diff of this commit:
cvs rdiff -u -r1.329 -r1.330 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.329 src/sys/dev/pci/ixgbe/ixgbe.c:1.330
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.329	Wed Sep 13 08:05:23 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Sep 14 08:47:24 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.329 2023/09/13 08:05:23 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.330 2023/09/14 08:47:24 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.329 2023/09/13 08:05:23 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.330 2023/09/14 08:47:24 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1861,20 +1861,20 @@ ixgbe_add_hw_stats(struct adapter *adapt
 			evcnt_attach_dynamic(>pxontxc[i],
 			EVCNT_TYPE_MISC, NULL, adapter->tcs[i].evnamebuf,
 			"pxontxc");
-			evcnt_attach_dynamic(>pxonrxc[i],
-			EVCNT_TYPE_MISC, NULL, adapter->tcs[i].evnamebuf,
-			"pxonrxc");
 			evcnt_attach_dynamic(>pxofftxc[i],
 			EVCNT_TYPE_MISC, NULL, adapter->tcs[i].evnamebuf,
 			"pxofftxc");
-			evcnt_attach_dynamic(>pxoffrxc[i],
-			EVCNT_TYPE_MISC, NULL, adapter->tcs[i].evnamebuf,
-			"pxoffrxc");
 			if (hw->mac.type >= ixgbe_mac_82599EB)
 evcnt_attach_dynamic(>pxon2offc[i],
 EVCNT_TYPE_MISC, NULL,
 adapter->tcs[i].evnamebuf,
 "pxon2offc");
+			evcnt_attach_dynamic(>pxonrxc[i],
+			EVCNT_TYPE_MISC, NULL, adapter->tcs[i].evnamebuf,
+			"pxonrxc");
+			evcnt_attach_dynamic(>pxoffrxc[i],
+			EVCNT_TYPE_MISC, NULL, adapter->tcs[i].evnamebuf,
+			"pxoffrxc");
 		}
 	}
 
@@ -2057,10 +2057,10 @@ ixgbe_add_hw_stats(struct adapter *adapt
 	stats->namebuf, "Receive Length Errors");
 	evcnt_attach_dynamic(>lxontxc, EVCNT_TYPE_MISC, NULL,
 	stats->namebuf, "Link XON Transmitted");
-	evcnt_attach_dynamic(>lxonrxc, EVCNT_TYPE_MISC, NULL,
-	stats->namebuf, "Link XON Received");
 	evcnt_attach_dynamic(>lxofftxc, EVCNT_TYPE_MISC, NULL,
 	stats->namebuf, "Link XOFF Transmitted");
+	evcnt_attach_dynamic(>lxonrxc, EVCNT_TYPE_MISC, NULL,
+	stats->namebuf, "Link XON Received");
 	evcnt_attach_dynamic(>lxoffrxc, EVCNT_TYPE_MISC, NULL,
 	stats->namebuf, "Link XOFF Received");
 



CVS commit: src/sys/dev/pci/ixgbe

2023-09-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 14 08:47:24 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
ixg(4): Reorder some flow control related event counters for readability.


To generate a diff of this commit:
cvs rdiff -u -r1.329 -r1.330 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.