head	1.32;
access;
symbols
	perseant-exfatfs-base-20250801:1.32
	netbsd-10-1-RELEASE:1.29
	perseant-exfatfs-base-20240630:1.32
	perseant-exfatfs:1.32.0.2
	perseant-exfatfs-base:1.32
	netbsd-8-3-RELEASE:1.2
	netbsd-9-4-RELEASE:1.2
	netbsd-10-0-RELEASE:1.29
	netbsd-10-0-RC6:1.29
	netbsd-10-0-RC5:1.29
	netbsd-10-0-RC4:1.29
	netbsd-10-0-RC3:1.29
	netbsd-10-0-RC2:1.29
	netbsd-10-0-RC1:1.29
	netbsd-10:1.29.0.2
	netbsd-10-base:1.29
	netbsd-9-3-RELEASE:1.2
	cjep_sun2x-base1:1.20
	cjep_sun2x:1.20.0.4
	cjep_sun2x-base:1.20
	cjep_staticlib_x-base1:1.20
	netbsd-9-2-RELEASE:1.2
	cjep_staticlib_x:1.20.0.2
	cjep_staticlib_x-base:1.20
	netbsd-9-1-RELEASE:1.2
	phil-wifi-20200421:1.2
	phil-wifi-20200411:1.2
	is-mlppp:1.2.0.50
	is-mlppp-base:1.2
	phil-wifi-20200406:1.2
	netbsd-8-2-RELEASE:1.2
	netbsd-9-0-RELEASE:1.2
	netbsd-9-0-RC2:1.2
	netbsd-9-0-RC1:1.2
	phil-wifi-20191119:1.2
	netbsd-9:1.2.0.48
	netbsd-9-base:1.2
	phil-wifi-20190609:1.2
	netbsd-8-1-RELEASE:1.2
	netbsd-8-1-RC1:1.2
	pgoyette-compat-merge-20190127:1.2
	pgoyette-compat-20190127:1.2
	pgoyette-compat-20190118:1.2
	pgoyette-compat-1226:1.2
	pgoyette-compat-1126:1.2
	pgoyette-compat-1020:1.2
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.2
	netbsd-7-2-RELEASE:1.2
	pgoyette-compat-0728:1.2
	netbsd-8-0-RELEASE:1.2
	phil-wifi:1.2.0.46
	phil-wifi-base:1.2
	pgoyette-compat-0625:1.2
	netbsd-8-0-RC2:1.2
	pgoyette-compat-0521:1.2
	pgoyette-compat-0502:1.2
	pgoyette-compat-0422:1.2
	netbsd-8-0-RC1:1.2
	pgoyette-compat-0415:1.2
	pgoyette-compat-0407:1.2
	pgoyette-compat-0330:1.2
	pgoyette-compat-0322:1.2
	pgoyette-compat-0315:1.2
	netbsd-7-1-2-RELEASE:1.2
	pgoyette-compat:1.2.0.44
	pgoyette-compat-base:1.2
	netbsd-7-1-1-RELEASE:1.2
	matt-nb8-mediatek:1.2.0.42
	matt-nb8-mediatek-base:1.2
	perseant-stdc-iso10646:1.2.0.40
	perseant-stdc-iso10646-base:1.2
	netbsd-8:1.2.0.38
	netbsd-8-base:1.2
	prg-localcount2-base3:1.2
	prg-localcount2-base2:1.2
	prg-localcount2-base1:1.2
	prg-localcount2:1.2.0.36
	prg-localcount2-base:1.2
	pgoyette-localcount-20170426:1.2
	bouyer-socketcan-base1:1.2
	pgoyette-localcount-20170320:1.2
	netbsd-7-1:1.2.0.34
	netbsd-7-1-RELEASE:1.2
	netbsd-7-1-RC2:1.2
	netbsd-7-nhusb-base-20170116:1.2
	bouyer-socketcan:1.2.0.32
	bouyer-socketcan-base:1.2
	pgoyette-localcount-20170107:1.2
	netbsd-7-1-RC1:1.2
	pgoyette-localcount-20161104:1.2
	netbsd-7-0-2-RELEASE:1.2
	localcount-20160914:1.2
	netbsd-7-nhusb:1.2.0.30
	netbsd-7-nhusb-base:1.2
	pgoyette-localcount-20160806:1.2
	pgoyette-localcount-20160726:1.2
	pgoyette-localcount:1.2.0.28
	pgoyette-localcount-base:1.2
	netbsd-7-0-1-RELEASE:1.2
	netbsd-7-0:1.2.0.26
	netbsd-7-0-RELEASE:1.2
	netbsd-7-0-RC3:1.2
	netbsd-7-0-RC2:1.2
	netbsd-7-0-RC1:1.2
	netbsd-6-0-6-RELEASE:1.2
	netbsd-6-1-5-RELEASE:1.2
	netbsd-7:1.2.0.24
	netbsd-7-base:1.2
	yamt-pagecache-base9:1.2
	yamt-pagecache-tag8:1.2
	netbsd-6-1-4-RELEASE:1.2
	netbsd-6-0-5-RELEASE:1.2
	tls-earlyentropy:1.2.0.22
	tls-earlyentropy-base:1.2
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.2
	riastradh-drm2-base3:1.2
	netbsd-6-1-3-RELEASE:1.2
	netbsd-6-0-4-RELEASE:1.2
	netbsd-6-1-2-RELEASE:1.2
	netbsd-6-0-3-RELEASE:1.2
	netbsd-6-1-1-RELEASE:1.2
	riastradh-drm2-base2:1.2
	riastradh-drm2-base1:1.2
	riastradh-drm2:1.2.0.16
	riastradh-drm2-base:1.2
	netbsd-6-1:1.2.0.20
	netbsd-6-0-2-RELEASE:1.2
	netbsd-6-1-RELEASE:1.2
	netbsd-6-1-RC4:1.2
	netbsd-6-1-RC3:1.2
	agc-symver:1.2.0.18
	agc-symver-base:1.2
	netbsd-6-1-RC2:1.2
	netbsd-6-1-RC1:1.2
	yamt-pagecache-base8:1.2
	netbsd-6-0-1-RELEASE:1.2
	yamt-pagecache-base7:1.2
	matt-nb6-plus-nbase:1.2
	yamt-pagecache-base6:1.2
	netbsd-6-0:1.2.0.14
	netbsd-6-0-RELEASE:1.2
	netbsd-6-0-RC2:1.2
	tls-maxphys:1.2.0.12
	tls-maxphys-base:1.2
	matt-nb6-plus:1.2.0.10
	matt-nb6-plus-base:1.2
	netbsd-6-0-RC1:1.2
	yamt-pagecache-base5:1.2
	yamt-pagecache-base4:1.2
	netbsd-6:1.2.0.8
	netbsd-6-base:1.2
	yamt-pagecache-base3:1.2
	yamt-pagecache-base2:1.2
	yamt-pagecache:1.2.0.6
	yamt-pagecache-base:1.2
	cherry-xenmp:1.2.0.4
	cherry-xenmp-base:1.2
	bouyer-quota2-base:1.2
	bouyer-quota2:1.2.0.2
	bouyer-quota2-nbase:1.2;
locks; strict;
comment	@# @;


1.32
date	2023.09.14.21.08.12;	author rillig;	state dead;
branches;
next	1.31;
commitid	phvPgOENl5L9yMEE;

1.31
date	2023.09.13.20.31.58;	author rillig;	state Exp;
branches;
next	1.30;
commitid	62qExzlCpwvQlEEE;

1.30
date	2023.06.03.20.58.00;	author rillig;	state Exp;
branches;
next	1.29;
commitid	sylJEqs7fiwQNxrE;

1.29
date	2022.06.15.18.44.41;	author rillig;	state Exp;
branches;
next	1.28;
commitid	1rSHMbOG4ZaKpaID;

1.28
date	2022.04.16.22.21.10;	author rillig;	state Exp;
branches;
next	1.27;
commitid	JQr9kXMkIMhqxtAD;

1.27
date	2022.04.16.21.22.12;	author rillig;	state Exp;
branches;
next	1.26;
commitid	ZiLTUWyoF2SidtAD;

1.26
date	2022.04.16.21.14.33;	author rillig;	state Exp;
branches;
next	1.25;
commitid	IRCjih4BhHBqatAD;

1.25
date	2021.09.10.20.02.50;	author rillig;	state Exp;
branches;
next	1.24;
commitid	nqiwMDxXLUbtMr8D;

1.24
date	2021.08.14.12.46.23;	author rillig;	state Exp;
branches;
next	1.23;
commitid	XLx8EFjPPh6FdW4D;

1.23
date	2021.08.10.16.59.28;	author rillig;	state Exp;
branches;
next	1.22;
commitid	E0kyOkorwfrqLr4D;

1.22
date	2021.08.10.07.02.00;	author rillig;	state Exp;
branches;
next	1.21;
commitid	MaYv5yjsykvyso4D;

1.21
date	2021.08.10.06.31.16;	author rillig;	state Exp;
branches;
next	1.20;
commitid	xQAgZhaKGgRYho4D;

1.20
date	2021.04.01.14.59.21;	author rillig;	state Exp;
branches;
next	1.19;
commitid	TQMAOvpL2nZ3fBNC;

1.19
date	2021.03.20.20.39.35;	author rillig;	state Exp;
branches;
next	1.18;
commitid	8JisTwZbYuNsy5MC;

1.18
date	2021.03.20.20.15.37;	author rillig;	state Exp;
branches;
next	1.17;
commitid	7iZVrRlLrbxQm5MC;

1.17
date	2021.03.18.21.56.34;	author rillig;	state Exp;
branches;
next	1.16;
commitid	JlCQQswlLkTV3QLC;

1.16
date	2021.02.20.18.02.58;	author rillig;	state Exp;
branches;
next	1.15;
commitid	cvuqAx85wKFYBtIC;

1.15
date	2021.01.17.15.06.54;	author rillig;	state Exp;
branches;
next	1.14;
commitid	aBYn5u2snM0SI5EC;

1.14
date	2021.01.17.14.55.22;	author rillig;	state Exp;
branches;
next	1.13;
commitid	mwjj6JLWMClaF5EC;

1.13
date	2021.01.17.14.50.11;	author rillig;	state Exp;
branches;
next	1.12;
commitid	BPN3bSdl9SGnD5EC;

1.12
date	2021.01.16.19.03.47;	author rillig;	state Exp;
branches;
next	1.11;
commitid	BNj4jLGdqCaC4ZDC;

1.11
date	2021.01.15.22.07.54;	author rillig;	state Exp;
branches;
next	1.10;
commitid	BOgwYsIJbs4H7SDC;

1.10
date	2021.01.12.20.42.01;	author rillig;	state Exp;
branches;
next	1.9;
commitid	61fSFY1hVF47KtDC;

1.9
date	2021.01.09.22.19.11;	author rillig;	state Exp;
branches;
next	1.8;
commitid	mPSuai28T6oRm6DC;

1.8
date	2021.01.09.17.36.10;	author rillig;	state Exp;
branches;
next	1.7;
commitid	dHEbQOepTv3bO4DC;

1.7
date	2021.01.05.23.50.29;	author rillig;	state Exp;
branches;
next	1.6;
commitid	43hJd0qRNo7pZACC;

1.6
date	2021.01.05.23.07.49;	author rillig;	state Exp;
branches;
next	1.5;
commitid	GOTdZt2AeGNGFACC;

1.5
date	2021.01.05.21.40.42;	author rillig;	state Exp;
branches;
next	1.4;
commitid	JUHPfwL4qIuQhACC;

1.4
date	2021.01.05.21.32.47;	author rillig;	state Exp;
branches;
next	1.3;
commitid	3CBoBES9nL4AfACC;

1.3
date	2021.01.05.16.34.37;	author rillig;	state Exp;
branches;
next	1.2;
commitid	6W7oa545sL0rByCC;

1.2
date	2011.02.05.17.14.14;	author christos;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2011.02.04.23.32.44;	author christos;	state Exp;
branches;
next	;

1.2.2.1
date	2011.02.05.17.14.14;	author bouyer;	state dead;
branches;
next	1.2.2.2;

1.2.2.2
date	2011.02.08.16.20.13;	author bouyer;	state Exp;
branches;
next	;


desc
@@


1.32
log
@lint: remove preprocessor magic from definition of operators

No binary change.
@
text
@/*	$NetBSD: ops.def,v 1.31 2023/09/13 20:31:58 rillig Exp $ */

begin_ops()

/*
 * Operator properties; see mod_t in op.h.
 *
 *	has operands		- - - - - - - - - - - - - - - - - - - - x
 *	warn if operand '='					      x	|
 *	bad on enum						    x	|
 *	valid on enum						  x	|
 *	comparison		- - - - - - - - - - - - - - - - x	|
 *	possible precedence confusion			      x	|	|
 *	warn if right operand unsigned			    x	|	|
 *	warn if left operand unsigned			  x	|	|
 *	has side effects	- - - - - - - - - - - - x	|	|
 *	balance operands			      x	|	|	|
 *	(unused)				    x	|	|	|
 *	value context				  x	|	|	|
 *	fold constant operands	- - - - - - - - x	|	|	|
 *	requires scalar			      x	|	|	|	|
 *	requires arithmetic		    x	|	|	|	|
 *	requires integer or complex	  x	|	|	|	|
 *	requires integer	- - - - x	|	|	|	|
 *	compares with zero	      x	|	|	|	|	|
 *	takes _Bool		    x	|	|	|	|	|
 *	logical			  x	|	|	|	|	|
 *	binary			x	|	|	|	|	|
 */
/*	name	repr		b l b z i c a s f v - b s l r p c e e =	o */
op(	NOOP,	"no-op",	 , , , , , , , , , , , , , , , , , , , , )
op(	ARROW,	"->",		1, ,1, , , , , , ,1, , , , , , , , , , ,1)
op(	POINT,	".",		1, ,1, , , , , , , , , , , , , , , , , ,1)
op(	NOT,	"!",		 ,1,1,1, , , ,1,1, , , , , , , , , ,1, ,1)
op(	COMPL,	"~",		 , , , , ,1, , ,1,1, , , , , , , , ,1,1,1)
op(	INC,	"++",		 , , , , , , , , , , , , , , , , , , , ,1)
op(	DEC,	"--",		 , , , , , , , , , , , , , , , , , , , ,1)
/*
 * The '++' and '--' operators are conceptually unary operators, but lint
 * implements them as binary operators due to the pre-multiplied pointer
 * arithmetics, see build_prepost_incdec and build_plus_minus.
 */
op(	INCBEF,	"++x",		 , , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	DECBEF,	"--x",		 , , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	INCAFT,	"x++",		 , , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	DECAFT,	"x--",		 , , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	UPLUS,	"+",		 , , , , , ,1, ,1,1, , , , , , , , ,1,1,1)
op(	UMINUS,	"-",		 , , , , , ,1, ,1,1, , , ,1, , , , ,1,1,1)
op(	INDIR,	"*",		 , , , , , , , , ,1, , , , , , , , , , ,1)
op(	ADDR,	"&",		 , ,1, , , , , , , , , , , , , , , , , ,1)
/* the operator 'arr[ind]' is translated to '*(arr + ind)' during parsing. */

/*	name	repr		b l b z i c a s f v - b s l r p c e e =	o */
op(	MULT,	"*",		1, , , , , ,1, ,1,1, ,1, , ,1, , , ,1,1,1)
op(	DIV,	"/",		1, , , , , ,1, ,1,1, ,1, ,1,1, , , ,1,1,1)
op(	MOD,	"%",		1, , , ,1, , , ,1,1, ,1, ,1,1, , , ,1,1,1)
op(	PLUS,	"+",		1, , , , , , ,1,1,1, ,1, , , , , , ,1, ,1)
op(	MINUS,	"-",		1, , , , , , ,1,1,1, ,1, , , , , , ,1, ,1)
op(	SHL,	"<<",		1, , , ,1, , , ,1,1, , , , , ,1, , ,1,1,1)
op(	SHR,	">>",		1, , , ,1, , , ,1,1, , , ,1, ,1, , ,1,1,1)

/*	name	repr		b l b z i c a s f v - b s l r p c e e =	o */
op(	LT,	"<",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,1)
op(	LE,	"<=",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,1)
op(	GT,	">",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,1)
op(	GE,	">=",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,1)
op(	EQ,	"==",		1,1,1, , , , ,1,1,1, ,1, , , , ,1,1, ,1,1)
op(	NE,	"!=",		1,1,1, , , , ,1,1,1, ,1, , , , ,1,1, ,1,1)

/*	name	repr		b l b z i c a s f v - b s l r p c e e =	o */
op(	BITAND,	"&",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,1)
op(	BITXOR,	"^",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,1)
op(	BITOR,	"|",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,1)
op(	LOGAND,	"&&",		1,1,1,1, , , ,1,1, , , , , , , , , ,1, ,1)
op(	LOGOR,	"||",		1,1,1,1, , , ,1,1, , , , , , ,1, , ,1, ,1)
op(	QUEST,	"?",		1, , ,1, , , , ,1, , , , , , , , , , , ,1)
op(	COLON,	":",		1, ,1, , , , , , ,1, ,1, , , , , ,1, , ,1)

/*	name	repr		b l b z i c a s f v - b s l r p c e e =	o */
op(	ASSIGN,	"=",		1, ,1, , , , , , , , , ,1, , , , ,1, , ,1)
op(	MULASS,	"*=",		1, , , , , ,1, , , , , ,1, , , , , ,1, ,1)
op(	DIVASS,	"/=",		1, , , , , ,1, , , , , ,1, ,1, , , ,1, ,1)
op(	MODASS,	"%=",		1, , , ,1, , , , , , , ,1, ,1, , , ,1, ,1)
op(	ADDASS,	"+=",		1, , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	SUBASS,	"-=",		1, , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	SHLASS,	"<<=",		1, , , ,1, , , , , , , ,1, , , , , ,1, ,1)
op(	SHRASS,	">>=",		1, , , ,1, , , , , , , ,1, , , , , ,1, ,1)
op(	ANDASS,	"&=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, ,1)
op(	XORASS,	"^=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, ,1)
op(	ORASS,	"|=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, ,1)

/*	name	repr		b l b z i c a s f v - b s l r p c e e =	o */
op(	NAME,	"name",		 , , , , , , , , , , , , , , , , , , , , )
op(	CON,	"constant",	 , , , , , , , , , , , , , , , , , , , , )
op(	STRING,	"string",	 , , , , , , , , , , , , , , , , , , , , )
op(	FSEL,	"fsel",		 , , , , , , , , , , , , , , , , , , , ,1)
op(	CALL,	"call",		1, , , , , , , , , , , ,1, , , , , , , ,1)
op(	COMMA,	",",		1, ,1, , , , , , , , , , , , , , , , ,1,1)
op(	CVT,	"convert",	 , , , , , , , , ,1, , , , , , , , , , ,1)
op(	ICALL,	"icall",	1, , , , , , , , , , , ,1, , , , , , , ,1)
op(	LOAD,	"load",		 , , , , , , , , , , , , , , , , , , , ,1)
/*
 * 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))).
 */
op(	PUSH,	"push",		 , , , , , , , , ,1, , , , , , , , , , ,1)
op(	RETURN,	"return",	1, ,1, , , , , , , , , ,1, , , , ,1, , ,1)
op(	REAL,	"real",		 , , , , , , , , , , , , , , , , , , , ,1)
op(	IMAG,	"imag",		 , , , , , , , , , , , , , , , , , , , ,1)

/* INIT, CASE and FARG are pseudo operators that don't appear in the tree. */
/*	name	repr		b l b z i c a s f v - b s l r p c e e =	o */
op(	INIT,	"init",		1, ,1, , , , , , , , , ,1, , , , ,1, , ,1)
op(	CASE,	"case",		 , , , , , , , , , , , , , , , , , , , , )
/*
 * FARG is only used temporarily in check_prototype_argument to check type
 * compatibility and conversion for function arguments.
 */
op(	FARG,	"farg",		1, ,1, , , , , , , , , , , , , , ,1, , ,1)

end_ops()

#ifndef NOPS
#  define NOPS ((int)FARG + 1)
#endif

#undef begin_ops
#undef op
#undef end_ops
@


1.31
log
@lint: prevent invalid memory access when checking an expression

In check_expr_misc, the left and right operands of an expression were
accessed even in the case of CON (constant), STRING (string literal) and
NAME (identifier), which led to invalid values in pointer variables.
These invalid values were not used though, but technically they invoked
undefined behavior.

Precede each access to the operands with a check that the expression
indeed has operands, except in those cases where the operand is known to
have operands by only looking at the code of the current function.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.30 2023/06/03 20:58:00 rillig Exp $ */
@


1.30
log
@lint: loosen assertion that unary operators have only a single operand
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.29 2022/06/15 18:44:41 rillig Exp $ */
d8 21
a28 20
 *	warn if operand '='					      x
 *	bad on enum						    x
 *	valid on enum						  x
 *	comparison		- - - - - - - - - - - - - - - - x
 *	possible precedence confusion			      x	|
 *	warn if right operand unsigned			    x	|
 *	warn if left operand unsigned			  x	|
 *	has side effects	- - - - - - - - - - - - x	|
 *	balance operands			      x	|	|
 *	(unused)				    x	|	|
 *	value context				  x	|	|
 *	fold constant operands	- - - - - - - - x	|	|
 *	requires scalar			      x	|	|	|
 *	requires arithmetic		    x	|	|	|
 *	requires integer or complex	  x	|	|	|
 *	requires integer	- - - - x	|	|	|
 *	compares with zero	      x	|	|	|	|
 *	takes _Bool		    x	|	|	|	|
 *	logical			  x	|	|	|	|
 *	binary			x	|	|	|	|
d30 8
a37 8
/*	name	repr		b l b z i c a s f v - b s l r p c e e =	*/
op(	NOOP,	"no-op",	 , , , , , , , , , , , , , , , , , , , )
op(	ARROW,	"->",		1, ,1, , , , , , ,1, , , , , , , , , , )
op(	POINT,	".",		1, ,1, , , , , , , , , , , , , , , , , )
op(	NOT,	"!",		 ,1,1,1, , , ,1,1, , , , , , , , , ,1, )
op(	COMPL,	"~",		 , , , , ,1, , ,1,1, , , , , , , , ,1,1)
op(	INC,	"++",		 , , , , , , , , , , , , , , , , , , , )
op(	DEC,	"--",		 , , , , , , , , , , , , , , , , , , , )
d43 8
a50 8
op(	INCBEF,	"++x",		 , , , , , , ,1, , , , ,1, , , , , ,1, )
op(	DECBEF,	"--x",		 , , , , , , ,1, , , , ,1, , , , , ,1, )
op(	INCAFT,	"x++",		 , , , , , , ,1, , , , ,1, , , , , ,1, )
op(	DECAFT,	"x--",		 , , , , , , ,1, , , , ,1, , , , , ,1, )
op(	UPLUS,	"+",		 , , , , , ,1, ,1,1, , , , , , , , ,1,1)
op(	UMINUS,	"-",		 , , , , , ,1, ,1,1, , , ,1, , , , ,1,1)
op(	INDIR,	"*",		 , , , , , , , , ,1, , , , , , , , , , )
op(	ADDR,	"&",		 , ,1, , , , , , , , , , , , , , , , , )
d53 49
a101 49
/*	name	repr		b l b z i c a s f v - b s l r p c e e =	*/
op(	MULT,	"*",		1, , , , , ,1, ,1,1, ,1, , ,1, , , ,1,1)
op(	DIV,	"/",		1, , , , , ,1, ,1,1, ,1, ,1,1, , , ,1,1)
op(	MOD,	"%",		1, , , ,1, , , ,1,1, ,1, ,1,1, , , ,1,1)
op(	PLUS,	"+",		1, , , , , , ,1,1,1, ,1, , , , , , ,1, )
op(	MINUS,	"-",		1, , , , , , ,1,1,1, ,1, , , , , , ,1, )
op(	SHL,	"<<",		1, , , ,1, , , ,1,1, , , , , ,1, , ,1,1)
op(	SHR,	">>",		1, , , ,1, , , ,1,1, , , ,1, ,1, , ,1,1)

/*	name	repr		b l b z i c a s f v - b s l r p c e e =	*/
op(	LT,	"<",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1)
op(	LE,	"<=",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1)
op(	GT,	">",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1)
op(	GE,	">=",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1)
op(	EQ,	"==",		1,1,1, , , , ,1,1,1, ,1, , , , ,1,1, ,1)
op(	NE,	"!=",		1,1,1, , , , ,1,1,1, ,1, , , , ,1,1, ,1)

/*	name	repr		b l b z i c a s f v - b s l r p c e e =	*/
op(	BITAND,	"&",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, )
op(	BITXOR,	"^",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, )
op(	BITOR,	"|",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, )
op(	LOGAND,	"&&",		1,1,1,1, , , ,1,1, , , , , , , , , ,1, )
op(	LOGOR,	"||",		1,1,1,1, , , ,1,1, , , , , , ,1, , ,1, )
op(	QUEST,	"?",		1, , ,1, , , , ,1, , , , , , , , , , , )
op(	COLON,	":",		1, ,1, , , , , , ,1, ,1, , , , , ,1, , )

/*	name	repr		b l b z i c a s f v - b s l r p c e e =	*/
op(	ASSIGN,	"=",		1, ,1, , , , , , , , , ,1, , , , ,1, , )
op(	MULASS,	"*=",		1, , , , , ,1, , , , , ,1, , , , , ,1, )
op(	DIVASS,	"/=",		1, , , , , ,1, , , , , ,1, ,1, , , ,1, )
op(	MODASS,	"%=",		1, , , ,1, , , , , , , ,1, ,1, , , ,1, )
op(	ADDASS,	"+=",		1, , , , , , ,1, , , , ,1, , , , , ,1, )
op(	SUBASS,	"-=",		1, , , , , , ,1, , , , ,1, , , , , ,1, )
op(	SHLASS,	"<<=",		1, , , ,1, , , , , , , ,1, , , , , ,1, )
op(	SHRASS,	">>=",		1, , , ,1, , , , , , , ,1, , , , , ,1, )
op(	ANDASS,	"&=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, )
op(	XORASS,	"^=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, )
op(	ORASS,	"|=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, )

/*	name	repr		b l b z i c a s f v - b s l r p c e e =	*/
op(	NAME,	"name",		 , , , , , , , , , , , , , , , , , , , )
op(	CON,	"constant",	 , , , , , , , , , , , , , , , , , , , )
op(	STRING,	"string",	 , , , , , , , , , , , , , , , , , , , )
op(	FSEL,	"fsel",		 , , , , , , , , , , , , , , , , , , , )
op(	CALL,	"call",		1, , , , , , , , , , , ,1, , , , , , , )
op(	COMMA,	",",		1, ,1, , , , , , , , , , , , , , , , ,1)
op(	CVT,	"convert",	 , , , , , , , , ,1, , , , , , , , , , )
op(	ICALL,	"icall",	1, , , , , , , , , , , ,1, , , , , , , )
op(	LOAD,	"load",		 , , , , , , , , , , , , , , , , , , , )
d108 4
a111 4
op(	PUSH,	"push",		 , , , , , , , , ,1, , , , , , , , , , )
op(	RETURN,	"return",	1, ,1, , , , , , , , , ,1, , , , ,1, , )
op(	REAL,	"real",		 , , , , , , , , , , , , , , , , , , , )
op(	IMAG,	"imag",		 , , , , , , , , , , , , , , , , , , , )
d114 3
a116 3
/*	name	repr		b l b z i c a s f v - b s l r p c e e =	*/
op(	INIT,	"init",		1, ,1, , , , , , , , , ,1, , , , ,1, , )
op(	CASE,	"case",		 , , , , , , , , , , , , , , , , , , , )
d121 1
a121 1
op(	FARG,	"farg",		1, ,1, , , , , , , , , , , , , , ,1, , )
@


1.29
log
@lint: update comments in operator table

No binary change.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.28 2022/04/16 22:21:10 rillig Exp $ */
d37 5
@


1.28
log
@lint: merge mod_t.m_test_context into m_requires_bool

These two flags mean exactly the same.

No functional change.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.27 2022/04/16 21:22:12 rillig Exp $ */
d24 1
a24 1
 *	requires _Bool		      x	|	|	|	|
d29 1
a29 1
/*	name	repr		b l b B i c a s f v - b s l r p c e e =	*/
d47 1
a47 1
/*	name	repr		b l b B i c a s f v - b s l r p c e e =	*/
d56 1
a56 1
/*	name	repr		b l b B i c a s f v - b s l r p c e e =	*/
d64 1
a64 1
/*	name	repr		b l b B i c a s f v - b s l r p c e e =	*/
d73 1
a73 1
/*	name	repr		b l b B i c a s f v - b s l r p c e e =	*/
d86 1
a86 1
/*	name	repr		b l b B i c a s f v - b s l r p c e e =	*/
d108 1
a108 1
/*	name	repr		b l b B i c a s f v - b s l r p c e e =	*/
@


1.27
log
@lint: clean up table with operator properties

Now that lint may use C99, make use of empty macro arguments.

No binary change.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.26 2022/04/16 21:14:33 rillig Exp $ */
d17 1
a17 1
 *	test context				    x	|	|
d29 1
a29 1
/*	name	repr		b l b B i c a s f v t b s l r p c e e =	*/
d33 1
a33 1
op(	NOT,	"!",		 ,1,1,1, , , ,1,1, ,1, , , , , , , ,1, )
d47 1
a47 1
/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
d56 1
a56 1
/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
d64 1
a64 1
/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
d68 3
a70 3
op(	LOGAND,	"&&",		1,1,1,1, , , ,1,1, ,1, , , , , , , ,1, )
op(	LOGOR,	"||",		1,1,1,1, , , ,1,1, ,1, , , , ,1, , ,1, )
op(	QUEST,	"?",		1, , , , , , , ,1, ,1, , , , , , , , , )
d73 1
a73 1
/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
d86 1
a86 1
/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
d108 1
a108 1
/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
@


1.26
log
@lint: rename members of tnode_t to more closely match reality

The flags do not describe the left operand of the node but both, as for
most operators, either none or both operands are in test context or in
value context.

The one exception is the operator '?' from the '?:' conditional, for
which the left operand is in test context and the right operand is in
value context.

No binary change.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.25 2021/09/10 20:02:50 rillig Exp $ */
d30 15
a44 15
op(	NOOP,	"no-op",	-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
op(	ARROW,	"->",		1,-,1,-,-,-,-,-,-,1,-,-,-,-,-,-,-,-,-,-)
op(	POINT,	".",		1,-,1,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
op(	NOT,	"!",		-,1,1,1,-,-,-,1,1,-,1,-,-,-,-,-,-,-,1,-)
op(	COMPL,	"~",		-,-,-,-,-,1,-,-,1,1,-,-,-,-,-,-,-,-,1,1)
op(	INC,	"++",		-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
op(	DEC,	"--",		-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
op(	INCBEF,	"++x",		-,-,-,-,-,-,-,1,-,-,-,-,1,-,-,-,-,-,1,-)
op(	DECBEF,	"--x",		-,-,-,-,-,-,-,1,-,-,-,-,1,-,-,-,-,-,1,-)
op(	INCAFT,	"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1,-,1,-,-,-,-,1,1,-,1)

/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
op(	BITAND,	"&",		1,-,1,-,1,-,-,-,1,1,-,1,-,-,-,1,-,-,1,-)
op(	BITXOR,	"^",		1,-,1,-,1,-,-,-,1,1,-,1,-,-,-,1,-,-,1,-)
op(	BITOR,	"|",		1,-,1,-,1,-,-,-,1,1,-,1,-,-,-,1,-,-,1,-)
op(	LOGAND,	"&&",		1,1,1,1,-,-,-,1,1,-,1,-,-,-,-,-,-,-,1,-)
op(	LOGOR,	"||",		1,1,1,1,-,-,-,1,1,-,1,-,-,-,-,1,-,-,1,-)
op(	QUEST,	"?",		1,-,-,-,-,-,-,-,1,-,1,-,-,-,-,-,-,-,-,-)
op(	COLON,	":",		1,-,1,-,-,-,-,-,-,1,-,1,-,-,-,-,-,1,-,-)

/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
op(	ASSIGN,	"=",		1,-,1,-,-,-,-,-,-,-,-,-,1,-,-,-,-,1,-,-)
op(	MULASS,	"*=",		1,-,-,-,-,-,1,-,-,-,-,-,1,-,-,-,-,-,1,-)
op(	DIVASS,	"/=",		1,-,-,-,-,-,1,-,-,-,-,-,1,-,1,-,-,-,1,-)
op(	MODASS,	"%=",		1,-,-,-,1,-,-,-,-,-,-,-,1,-,1,-,-,-,1,-)
op(	ADDASS,	"+=",		1,-,-,-,-,-,-,1,-,-,-,-,1,-,-,-,-,-,1,-)
op(	SUBASS,	"-=",		1,-,-,-,-,-,-,1,-,-,-,-,1,-,-,-,-,-,1,-)
op(	SHLASS,	"<<=",		1,-,-,-,1,-,-,-,-,-,-,-,1,-,-,-,-,-,1,-)
op(	SHRASS,	">>=",		1,-,-,-,1,-,-,-,-,-,-,-,1,-,-,-,-,-,1,-)
op(	ANDASS,	"&=",		1,-,1,-,1,-,-,-,-,-,-,-,1,-,-,-,-,-,1,-)
op(	XORASS,	"^=",		1,-,1,-,1,-,-,-,-,-,-,-,1,-,-,-,-,-,1,-)
op(	ORASS,	"|=",		1,-,1,-,1,-,-,-,-,-,-,-,1,-,-,-,-,-,1,-)

/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
op(	NAME,	"name",		-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
op(	CON,	"constant",	-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
op(	STRING,	"string",	-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
op(	FSEL,	"fsel",		-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
op(	CALL,	"call",		1,-,-,-,-,-,-,-,-,-,-,-,1,-,-,-,-,-,-,-)
op(	COMMA,	",",		1,-,1,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,1)
op(	CVT,	"convert",	-,-,-,-,-,-,-,-,-,1,-,-,-,-,-,-,-,-,-,-)
op(	ICALL,	"icall",	1,-,-,-,-,-,-,-,-,-,-,-,1,-,-,-,-,-,-,-)
op(	LOAD,	"load",		-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
d102 4
a105 4
op(	PUSH,	"push",		-,-,-,-,-,-,-,-,-,1,-,-,-,-,-,-,-,-,-,-)
op(	RETURN,	"return",	1,-,1,-,-,-,-,-,-,-,-,-,1,-,-,-,-,1,-,-)
op(	REAL,	"real",		-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
op(	IMAG,	"imag",		-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
d109 2
a110 2
op(	INIT,	"init",		1,-,1,-,-,-,-,-,-,-,-,-,1,-,-,-,-,1,-,-)
op(	CASE,	"case",		-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
d115 1
a115 1
op(	FARG,	"farg",		1,-,1,-,-,-,-,-,-,-,-,-,-,-,-,-,-,1,-,-)
@


1.25
log
@lint: replace space followed by tab with simply tab

No functional change.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.24 2021/08/14 12:46:23 rillig Exp $ */
d17 2
a18 2
 *	left test context			    x	|	|
 *	left value context			  x	|	|
@


1.24
log
@lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression.  The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different.  It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member.  Therefore it was wrong to use the
operator ASSIGN for initialization.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.23 2021/08/10 16:59:28 rillig Exp $ */
d8 1
a8 1
 * 	warn if operand '='					      x
@


1.23
log
@lint: fix documentation of FARG and PUSH
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.22 2021/08/10 07:02:00 rillig Exp $ */
d109 1
a109 1
op(	INIT,	"init",		1,-,1,-,-,-,-,-,-,-,-,-,-,-,-,-,-,1,-,-)
@


1.22
log
@lint: document the difference between FARG and PUSH
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.21 2021/08/10 06:31:16 rillig Exp $ */
d96 6
a110 2
op(	FARG,	"farg",		1,-,1,-,-,-,-,-,-,-,-,-,-,-,-,-,-,1,-,-)

d112 2
a113 7
 * Both FARG and PUSH represent function arguments.  FARG is used in the
 * early phase of analysis, when the node is not yet part of a function call
 * expression (CALL or ICALL).  Later, build_function_argument builds a
 * function call expression out of the FARG nodes, where they become PUSH.
 * In a function call expression, the PUSH nodes are ordered from right to
 * left, that is, the function call f(17, 23) is represented as
 * CALL(f, PUSH(23, PUSH(17, NULL))).
d115 1
@


1.21
log
@lint: document operator properties directly at the definition
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.20 2021/04/01 14:59:21 rillig Exp $ */
d107 10
@


1.20
log
@lint: replace empty macro arguments with non-empty arguments

Empty arguments are a new feature of C99.  Since lint is one of the
build tools, it is supposed to only use C90 features.  C99 6.10.3 "Macro
replacement" explicitly allows empty macro arguments while C90 3.8.3
"Macro replacement" last sentence defines an empty macro argument as
undefined behavior.

This change makes the '1's stick out less from the table.  I tried to
use '.' instead of '-' as well, but that made it too hard to see the
commas.

No functional change.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.19 2021/03/20 20:39:35 rillig Exp $ */
d5 24
a28 2
/* See mod_t in op.h for the definition of the table columns. */

@


1.19
log
@lint: remove redundant operator properties table

It's enough to have modtab, which describes the properties of the
various operators.  There is no need to have a second table imods that
holds the same content.  Rather make modtab constant as well.

The only possible functional change is that the names of the internal
operators 'no-op', '++', '--', 'real', 'imag' and 'case' may appear in
diagnostics, where previously lint invoked undefined behavior by passing
a null pointer for a '%s' conversion specifier.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.18 2021/03/20 20:15:37 rillig Exp $ */
d8 15
a22 15
op(	NOOP,	"no-op",	 , , , , , , , , , , , , , , , , , , , )
op(	ARROW,	"->",		1, ,1, , , , , , ,1, , , , , , , , , , )
op(	POINT,	".",		1, ,1, , , , , , , , , , , , , , , , , )
op(	NOT,	"!",		 ,1,1,1, , , ,1,1, ,1, , , , , , , ,1, )
op(	COMPL,	"~",		 , , , , ,1, , ,1,1, , , , , , , , ,1,1)
op(	INC,	"++",		 , , , , , , , , , , , , , , , , , , , )
op(	DEC,	"--",		 , , , , , , , , , , , , , , , , , , , )
op(	INCBEF,	"++x",		 , , , , , , ,1, , , , ,1, , , , , ,1, )
op(	DECBEF,	"--x",		 , , , , , , ,1, , , , ,1, , , , , ,1, )
op(	INCAFT,	"x++",		 , , , , , , ,1, , , , ,1, , , , , ,1, )
op(	DECAFT,	"x--",		 , , , , , , ,1, , , , ,1, , , , , ,1, )
op(	UPLUS,	"+",		 , , , , , ,1, ,1,1, , , , , , , , ,1,1)
op(	UMINUS,	"-",		 , , , , , ,1, ,1,1, , , ,1, , , , ,1,1)
op(	INDIR,	"*",		 , , , , , , , , ,1, , , , , , , , , , )
op(	ADDR,	"&",		 , ,1, , , , , , , , , , , , , , , , , )
d26 52
a77 52
op(	MULT,	"*",		1, , , , , ,1, ,1,1, ,1, , ,1, , , ,1,1)
op(	DIV,	"/",		1, , , , , ,1, ,1,1, ,1, ,1,1, , , ,1,1)
op(	MOD,	"%",		1, , , ,1, , , ,1,1, ,1, ,1,1, , , ,1,1)
op(	PLUS,	"+",		1, , , , , , ,1,1,1, ,1, , , , , , ,1, )
op(	MINUS,	"-",		1, , , , , , ,1,1,1, ,1, , , , , , ,1, )
op(	SHL,	"<<",		1, , , ,1, , , ,1,1, , , , , ,1, , ,1,1)
op(	SHR,	">>",		1, , , ,1, , , ,1,1, , , ,1, ,1, , ,1,1)

/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
op(	LT,	"<",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1)
op(	LE,	"<=",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1)
op(	GT,	">",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1)
op(	GE,	">=",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1)
op(	EQ,	"==",		1,1,1, , , , ,1,1,1, ,1, , , , ,1,1, ,1)
op(	NE,	"!=",		1,1,1, , , , ,1,1,1, ,1, , , , ,1,1, ,1)

/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
op(	BITAND,	"&",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, )
op(	BITXOR,	"^",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, )
op(	BITOR,	"|",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, )
op(	LOGAND,	"&&",		1,1,1,1, , , ,1,1, ,1, , , , , , , ,1, )
op(	LOGOR,	"||",		1,1,1,1, , , ,1,1, ,1, , , , ,1, , ,1, )
op(	QUEST,	"?",		1, , , , , , , ,1, ,1, , , , , , , , , )
op(	COLON,	":",		1, ,1, , , , , , ,1, ,1, , , , , ,1, , )

/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
op(	ASSIGN,	"=",		1, ,1, , , , , , , , , ,1, , , , ,1, , )
op(	MULASS,	"*=",		1, , , , , ,1, , , , , ,1, , , , , ,1, )
op(	DIVASS,	"/=",		1, , , , , ,1, , , , , ,1, ,1, , , ,1, )
op(	MODASS,	"%=",		1, , , ,1, , , , , , , ,1, ,1, , , ,1, )
op(	ADDASS,	"+=",		1, , , , , , ,1, , , , ,1, , , , , ,1, )
op(	SUBASS,	"-=",		1, , , , , , ,1, , , , ,1, , , , , ,1, )
op(	SHLASS,	"<<=",		1, , , ,1, , , , , , , ,1, , , , , ,1, )
op(	SHRASS,	">>=",		1, , , ,1, , , , , , , ,1, , , , , ,1, )
op(	ANDASS,	"&=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, )
op(	XORASS,	"^=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, )
op(	ORASS,	"|=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, )

/*	name	repr		b l b B i c a s f v t b s l r p c e e = */
op(	NAME,	"name",		 , , , , , , , , , , , , , , , , , , , )
op(	CON,	"constant",	 , , , , , , , , , , , , , , , , , , , )
op(	STRING,	"string",	 , , , , , , , , , , , , , , , , , , , )
op(	FSEL,	"fsel",		 , , , , , , , , , , , , , , , , , , , )
op(	CALL,	"call",		1, , , , , , , , , , , ,1, , , , , , , )
op(	COMMA,	",",		1, ,1, , , , , , , , , , , , , , , , ,1)
op(	CVT,	"convert",	 , , , , , , , , ,1, , , , , , , , , , )
op(	ICALL,	"icall",	1, , , , , , , , , , , ,1, , , , , , , )
op(	LOAD,	"load",		 , , , , , , , , , , , , , , , , , , , )
op(	PUSH,	"push",		 , , , , , , , , ,1, , , , , , , , , , )
op(	RETURN,	"return",	1, ,1, , , , , , , , , ,1, , , , ,1, , )
op(	REAL,	"real",		 , , , , , , , , , , , , , , , , , , , )
op(	IMAG,	"imag",		 , , , , , , , , , , , , , , , , , , , )
d81 3
a83 3
op(	INIT,	"init",		1, ,1, , , , , , , , , , , , , , ,1, , )
op(	CASE,	"case",		 , , , , , , , , , , , , , , , , , , , )
op(	FARG,	"farg",		1, ,1, , , , , , , , , , , , , , ,1, , )
@


1.18
log
@lint: fix argument names and table headings for operator definitions

The abbreviations in the table of operator properties had been wrong
since ops.def 1.10 from 2021-01-12, when strict bool mode was added.  In
an earlier working draft, I had named that column 'takes_others' instead
of 'requires_bool', that's where the 'o' came from.

The names of the macro arguments had been wrong since op.h 1.11 from
2021-01-09, when the order of the columns changed and the macros were
not adjusted accordingly.  Since all the properties of the operator
table are uniform, this didn't result in any bugs, it was just confusing
for human readers.

Clang-tidy suggests to enclose the macro arguments in oper.c in
parentheses but that is not possible since the arguments are either
empty or 1, and the syntactical ambiguity of the '+ 0' being either a
unary or a binary operator is needed here.

No change to the resulting binary.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.17 2021/03/18 21:56:34 rillig Exp $ */
d7 16
a22 16
/*	name	repr		b l b B i c a s f v t b s l r p c e e =	act */
op(	NOOP,	"no-op",	 , , , , , , , , , , , , , , , , , , , ,0)
op(	ARROW,	"->",		1, ,1, , , , , , ,1, , , , , , , , , , ,1)
op(	POINT,	".",		1, ,1, , , , , , , , , , , , , , , , , ,1)
op(	NOT,	"!",		 ,1,1,1, , , ,1,1, ,1, , , , , , , ,1, ,1)
op(	COMPL,	"~",		 , , , , ,1, , ,1,1, , , , , , , , ,1,1,1)
op(	INC,	"++",		 , , , , , , , , , , , , , , , , , , , ,0)
op(	DEC,	"--",		 , , , , , , , , , , , , , , , , , , , ,0)
op(	INCBEF,	"++x",		 , , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	DECBEF,	"--x",		 , , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	INCAFT,	"x++",		 , , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	DECAFT,	"x--",		 , , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	UPLUS,	"+",		 , , , , , ,1, ,1,1, , , , , , , , ,1,1,1)
op(	UMINUS,	"-",		 , , , , , ,1, ,1,1, , , ,1, , , , ,1,1,1)
op(	INDIR,	"*",		 , , , , , , , , ,1, , , , , , , , , , ,1)
op(	ADDR,	"&",		 , ,1, , , , , , , , , , , , , , , , , ,1)
d25 53
a77 53
/*	name	repr		b l b B i c a s f v t b s l r p c e e =	act */
op(	MULT,	"*",		1, , , , , ,1, ,1,1, ,1, , ,1, , , ,1,1,1)
op(	DIV,	"/",		1, , , , , ,1, ,1,1, ,1, ,1,1, , , ,1,1,1)
op(	MOD,	"%",		1, , , ,1, , , ,1,1, ,1, ,1,1, , , ,1,1,1)
op(	PLUS,	"+",		1, , , , , , ,1,1,1, ,1, , , , , , ,1, ,1)
op(	MINUS,	"-",		1, , , , , , ,1,1,1, ,1, , , , , , ,1, ,1)
op(	SHL,	"<<",		1, , , ,1, , , ,1,1, , , , , ,1, , ,1,1,1)
op(	SHR,	">>",		1, , , ,1, , , ,1,1, , , ,1, ,1, , ,1,1,1)

/*	name	repr		b l b B i c a s f v t b s l r p c e e =	act */
op(	LT,	"<",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,1)
op(	LE,	"<=",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,1)
op(	GT,	">",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,1)
op(	GE,	">=",		1,1, , , , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,1)
op(	EQ,	"==",		1,1,1, , , , ,1,1,1, ,1, , , , ,1,1, ,1,1)
op(	NE,	"!=",		1,1,1, , , , ,1,1,1, ,1, , , , ,1,1, ,1,1)

/*	name	repr		b l b B i c a s f v t b s l r p c e e =	act */
op(	BITAND,	"&",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,1)
op(	BITXOR,	"^",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,1)
op(	BITOR,	"|",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,1)
op(	LOGAND,	"&&",		1,1,1,1, , , ,1,1, ,1, , , , , , , ,1, ,1)
op(	LOGOR,	"||",		1,1,1,1, , , ,1,1, ,1, , , , ,1, , ,1, ,1)
op(	QUEST,	"?",		1, , , , , , , ,1, ,1, , , , , , , , , ,1)
op(	COLON,	":",		1, ,1, , , , , , ,1, ,1, , , , , ,1, , ,1)

/*	name	repr		b l b B i c a s f v t b s l r p c e e =	act */
op(	ASSIGN,	"=",		1, ,1, , , , , , , , , ,1, , , , ,1, , ,1)
op(	MULASS,	"*=",		1, , , , , ,1, , , , , ,1, , , , , ,1, ,1)
op(	DIVASS,	"/=",		1, , , , , ,1, , , , , ,1, ,1, , , ,1, ,1)
op(	MODASS,	"%=",		1, , , ,1, , , , , , , ,1, ,1, , , ,1, ,1)
op(	ADDASS,	"+=",		1, , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	SUBASS,	"-=",		1, , , , , , ,1, , , , ,1, , , , , ,1, ,1)
op(	SHLASS,	"<<=",		1, , , ,1, , , , , , , ,1, , , , , ,1, ,1)
op(	SHRASS,	">>=",		1, , , ,1, , , , , , , ,1, , , , , ,1, ,1)
op(	ANDASS,	"&=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, ,1)
op(	XORASS,	"^=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, ,1)
op(	ORASS,	"|=",		1, ,1, ,1, , , , , , , ,1, , , , , ,1, ,1)

/*	name	repr		b l b B i c a s f v t b s l r p c e e =	act */
op(	NAME,	"name",		 , , , , , , , , , , , , , , , , , , , ,1)
op(	CON,	"constant",	 , , , , , , , , , , , , , , , , , , , ,1)
op(	STRING,	"string",	 , , , , , , , , , , , , , , , , , , , ,1)
op(	FSEL,	"fsel",		 , , , , , , , , , , , , , , , , , , , ,1)
op(	CALL,	"call",		1, , , , , , , , , , , ,1, , , , , , , ,1)
op(	COMMA,	",",		1, ,1, , , , , , , , , , , , , , , , ,1,1)
op(	CVT,	"convert",	 , , , , , , , , ,1, , , , , , , , , , ,1)
op(	ICALL,	"icall",	1, , , , , , , , , , , ,1, , , , , , , ,1)
op(	LOAD,	"load",		 , , , , , , , , , , , , , , , , , , , ,1)
op(	PUSH,	"push",		 , , , , , , , , ,1, , , , , , , , , , ,1)
op(	RETURN,	"return",	1, ,1, , , , , , , , , ,1, , , , ,1, , ,1)
op(	REAL,	"real",		 , , , , , , , , , , , , , , , , , , , ,0)
op(	IMAG,	"imag",		 , , , , , , , , , , , , , , , , , , , ,0)
d80 4
a83 4
/*	name	repr		b l b B i c a s f v t b s l r p c e e =	act */
op(	INIT,	"init",		1, ,1, , , , , , , , , , , , , , ,1, , ,1)
op(	CASE,	"case",		 , , , , , , , , , , , , , , , , , , , ,0)
op(	FARG,	"farg",		1, ,1, , , , , , , , , , , , , , ,1, , ,1)
@


1.17
log
@lint: rename operator 'const' to 'constant'

The previous name could be too easily confused with the type qualifier
'const'.  The operator name is mainly used in the debug log, only
occasionally in the output.  Since 'constant' is not a "real" operator,
it probably doesn't occur in messages at all.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.16 2021/02/20 18:02:58 rillig Exp $ */
d7 1
a7 1
/*	name	repr		b l b o i c a s f v t b s l r p c e e =	act */
d25 1
a25 1
/*	name	repr		b l b o i c a s f v t b s l r p c e e =	act */
d34 1
a34 1
/*	name	repr		b l b o i c a s f v t b s l r p c e e =	act */
d42 1
a42 1
/*	name	repr		b l b o i c a s f v t b s l r p c e e =	act */
d51 1
a51 1
/*	name	repr		b l b o i c a s f v t b s l r p c e e =	act */
d64 1
a64 1
/*	name	repr		b l b o i c a s f v t b s l r p c e e =	act */
d80 1
a80 1
/*	name	repr		b l b o i c a s f v t b s l r p c e e =	act */
@


1.16
log
@lint: add test for using a bool as array index in strict bool mode
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.15 2021/01/17 15:06:54 rillig Exp $ */
d66 1
a66 1
op(	CON,	"const",	 , , , , , , , , , , , , , , , , , , , ,1)
@


1.15
log
@lint: rename bitwise operators

When there are several variants of the AND operator, both of them should
get a distinguishing prefix, otherwise it's not clear which of the two
possible operators is meant by the plain AND.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.14 2021/01/17 14:55:22 rillig Exp $ */
d23 1
@


1.14
log
@lint: rename operator STAR to INDIR

C99 calls this operator the "indirection operator".  The word "star"
does not occur in the index of that standard.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.13 2021/01/17 14:50:11 rillig Exp $ */
d42 3
a44 3
op(	AND,	"&",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,1)
op(	XOR,	"^",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,1)
op(	OR,	"|",		1, ,1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,1)
@


1.13
log
@lint: rename operator AMPER to ADDR

There is no operator called 'ampersand'.  The ampersand sign is merely
the textual representation of both the operator ADDR and the operator
BITAND.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.12 2021/01/16 19:03:47 rillig Exp $ */
d21 1
a21 1
op(	STAR,	"*",		 , , , , , , , , ,1, , , , , , , , , , ,1)
@


1.12
log
@lint: in strict bool mode, perform the normal checks as well
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.11 2021/01/15 22:07:54 rillig Exp $ */
d22 1
a22 1
op(	AMPER,	"&",		 , ,1, , , , , , , , , , , , , , , , , ,1)
@


1.11
log
@lint: in strict bool mode, allow bool as operands of the comma operator
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.10 2021/01/12 20:42:01 rillig Exp $ */
d74 1
a74 1
op(	RETURN,	"return",	1, , , , , , , , , , , ,1, , , , ,1, , ,1)
d82 1
a82 1
op(	FARG,	"farg",		1, , , , , , , , , , , , , , , , ,1, , ,1)
@


1.10
log
@lint: add new check for strict bool mode

In strict bool mode, bool is considered incompatible with all other
scalar types, just as in Java, C#, Pascal.

The controlling expressions in if statements, while loops, for loops and
the '?:' operator must be of type bool.  The logical operators work on
bool instead of int, the bitwise operators accept both integer and bool.
The arithmetic operators don't accept bool.

Since <stdbool.h> implements bool using C preprocessor macros instead of
predefining the identifiers "true" and "false", the integer constants 0
and 1 may be used in all contexts that require a bool expression.
Except from these, no implicit conversion between bool and scalar types
is allowed.

See usr.bin/tests/xlint/lint1/d_c99_bool_strict.c for more details.

The command line option -T has been chosen because all obvious choices
(-b or -B for bool, -s or -S for strict) are already in use.  The -T may
stand for "types are checked strictly".

The default behavior of lint doesn't change.  The strict bool check is
purely optional.

An example program for strict bool mode is usr.bin/make, which has been
using explicit comparisons such as p != NULL, ch != '\0' or n > 0 in
most places for a long time now, even before the refactoring in 2020.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.9 2021/01/09 22:19:11 rillig Exp $ */
d69 1
a69 1
op(	COMMA,	",",		1, , , , , , , , , , , , , , , , , , ,1,1)
@


1.9
log
@lint: make the table containing the operator properties more readable

The C preprocessor does not require its arguments to be expressions, an
empty string is valid as well.  This allows to replace the 0 in the
operator properties table with a space, making the 1 stick out.

Since the table is quite long, divide it into sections and add section
headers.

No change in the generated code.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.8 2021/01/09 17:36:10 rillig Exp $ */
d7 70
a76 70
/*	name	repr		b l i c a s f v t b s l r p c e e =	act */
op(	NOOP,	"no-op",	 , , , , , , , , , , , , , , , , , ,	0)
op(	ARROW,	"->",		1, , , , , , ,1, , , , , , , , , , ,	1)
op(	POINT,	".",		1, , , , , , , , , , , , , , , , , ,	1)
op(	NOT,	"!",		 ,1, , , ,1,1, ,1, , , , , , , ,1, ,	1)
op(	COMPL,	"~",		 , , ,1, , ,1,1, , , , , , , , ,1,1,	1)
op(	INC,	"++",		 , , , , , , , , , , , , , , , , , ,	0)
op(	DEC,	"--",		 , , , , , , , , , , , , , , , , , ,	0)
op(	INCBEF,	"++x",		 , , , , ,1, , , , ,1, , , , , ,1, ,	1)
op(	DECBEF,	"--x",		 , , , , ,1, , , , ,1, , , , , ,1, ,	1)
op(	INCAFT,	"x++",		 , , , , ,1, , , , ,1, , , , , ,1, ,	1)
op(	DECAFT,	"x--",		 , , , , ,1, , , , ,1, , , , , ,1, ,	1)
op(	UPLUS,	"+",		 , , , ,1, ,1,1, , , , , , , , ,1,1,	1)
op(	UMINUS,	"-",		 , , , ,1, ,1,1, , , ,1, , , , ,1,1,	1)
op(	STAR,	"*",		 , , , , , , ,1, , , , , , , , , , ,	1)
op(	AMPER,	"&",		 , , , , , , , , , , , , , , , , , ,	1)

/*	name	repr		b l i c a s f v t b s l r p c e e =	act */
op(	MULT,	"*",		1, , , ,1, ,1,1, ,1, , ,1, , , ,1,1,	1)
op(	DIV,	"/",		1, , , ,1, ,1,1, ,1, ,1,1, , , ,1,1,	1)
op(	MOD,	"%",		1, ,1, , , ,1,1, ,1, ,1,1, , , ,1,1,	1)
op(	PLUS,	"+",		1, , , , ,1,1,1, ,1, , , , , , ,1, ,	1)
op(	MINUS,	"-",		1, , , , ,1,1,1, ,1, , , , , , ,1, ,	1)
op(	SHL,	"<<",		1, ,1, , , ,1,1, , , , , ,1, , ,1,1,	1)
op(	SHR,	">>",		1, ,1, , , ,1,1, , , ,1, ,1, , ,1,1,	1)

/*	name	repr		b l i c a s f v t b s l r p c e e =	act */
op(	LT,	"<",		1,1, , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,	1)
op(	LE,	"<=",		1,1, , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,	1)
op(	GT,	">",		1,1, , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,	1)
op(	GE,	">=",		1,1, , , ,1,1,1, ,1, ,1,1, ,1,1, ,1,	1)
op(	EQ,	"==",		1,1, , , ,1,1,1, ,1, , , , ,1,1, ,1,	1)
op(	NE,	"!=",		1,1, , , ,1,1,1, ,1, , , , ,1,1, ,1,	1)

/*	name	repr		b l i c a s f v t b s l r p c e e =	act */
op(	AND,	"&",		1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,	1)
op(	XOR,	"^",		1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,	1)
op(	OR,	"|",		1, ,1, , , ,1,1, ,1, , , ,1, , ,1, ,	1)
op(	LOGAND,	"&&",		1,1, , , ,1,1, ,1, , , , , , , ,1, ,	1)
op(	LOGOR,	"||",		1,1, , , ,1,1, ,1, , , , ,1, , ,1, ,	1)
op(	QUEST,	"?",		1, , , , , ,1, ,1, , , , , , , , , ,	1)
op(	COLON,	":",		1, , , , , , ,1, ,1, , , , , ,1, , ,	1)

/*	name	repr		b l i c a s f v t b s l r p c e e =	act */
op(	ASSIGN,	"=",		1, , , , , , , , , ,1, , , , ,1, , ,	1)
op(	MULASS,	"*=",		1, , , ,1, , , , , ,1, , , , , ,1, ,	1)
op(	DIVASS,	"/=",		1, , , ,1, , , , , ,1, ,1, , , ,1, ,	1)
op(	MODASS,	"%=",		1, ,1, , , , , , , ,1, ,1, , , ,1, ,	1)
op(	ADDASS,	"+=",		1, , , , ,1, , , , ,1, , , , , ,1, ,	1)
op(	SUBASS,	"-=",		1, , , , ,1, , , , ,1, , , , , ,1, ,	1)
op(	SHLASS,	"<<=",		1, ,1, , , , , , , ,1, , , , , ,1, ,	1)
op(	SHRASS,	">>=",		1, ,1, , , , , , , ,1, , , , , ,1, ,	1)
op(	ANDASS,	"&=",		1, ,1, , , , , , , ,1, , , , , ,1, ,	1)
op(	XORASS,	"^=",		1, ,1, , , , , , , ,1, , , , , ,1, ,	1)
op(	ORASS,	"|=",		1, ,1, , , , , , , ,1, , , , , ,1, ,	1)

/*	name	repr		b l i c a s f v t b s l r p c e e =	act */
op(	NAME,	"name",		 , , , , , , , , , , , , , , , , , ,	1)
op(	CON,	"const",	 , , , , , , , , , , , , , , , , , ,	1)
op(	STRING,	"string",	 , , , , , , , , , , , , , , , , , ,	1)
op(	FSEL,	"fsel",		 , , , , , , , , , , , , , , , , , ,	1)
op(	CALL,	"call",		1, , , , , , , , , ,1, , , , , , , ,	1)
op(	COMMA,	",",		1, , , , , , , , , , , , , , , , ,1,	1)
op(	CVT,	"convert",	 , , , , , , ,1, , , , , , , , , , ,	1)
op(	ICALL,	"icall",	1, , , , , , , , , ,1, , , , , , , ,	1)
op(	LOAD,	"load",		 , , , , , , , , , , , , , , , , , ,	1)
op(	PUSH,	"push",		 , , , , , , ,1, , , , , , , , , , ,	1)
op(	RETURN,	"return",	1, , , , , , , , , ,1, , , , ,1, , ,	1)
op(	REAL,	"real",		 , , , , , , , , , , , , , , , , , ,	0)
op(	IMAG,	"imag",		 , , , , , , , , , , , , , , , , , ,	0)
d79 4
a82 4
/*	name	repr		b l i c a s f v t b s l r p c e e =	act */
op(	INIT,	"init",		1, , , , , , , , , , , , , , ,1, , ,	1)
op(	CASE,	"case",		 , , , , , , , , , , , , , , , , , ,	0)
op(	FARG,	"farg",		1, , , , , , , , , , , , , , ,1, , ,	1)
@


1.8
log
@lint: reorder table of operator properties

The 4 "requires" properties are now listed together, in descending
strictness.
@
text
@d1 1
a1 1
/*	$NetBSD: ops.def,v 1.7 2021/01/05 23:50:29 rillig Exp $ */
d4 46
d51 27
a77 59
op(	NOOP,	"no-op",	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	0)
op(	ARROW,	"->",		1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,	1)
op(	POINT,	".",		1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	1)
op(	NOT,	"!",		0,1,0,0,0,1,1,0,1,0,0,0,0,0,0,0,1,0,	1)
op(	COMPL,	"~",		0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,1,1,	1)
op(	INC,	"++",		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	0)
op(	DEC,	"--",		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	0)
op(	INCBEF,	"++x",		0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,	1)
op(	DECBEF,	"--x",		0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,	1)
op(	INCAF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,0,0,0,0,0,	1)
op(	STRING,	"string",	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	1)
op(	FSEL,	"fsel",		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	1)
op(	CALL,	"call",		1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,	1)
op(	COMMA,	",",		1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,	1)
op(	CVT,	"convert",	0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,	1)
op(	ICALL,	"icall",	1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,	1)
op(	LOAD,	"load",		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	1)
op(	PUSH,	"push",		0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,	1)
op(	RETURN,	"return",	1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,	1)
op(	REAL,	"real",		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	0)
op(	IMAG,	"imag",		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	0)
a78 3
op(	INIT,	"init",		1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,	1)
op(	CASE,	"case",		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	0)
op(	FARG,	"farg",		1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,	1)
d80 4
@


1.7
log
@lint: clean up generation of the operator tables

Instead of running a shell program that runs an AWK program that
generates the two files ops.c and ops.h, just define the operator tables
once in ops.def and use these definitions flexibly in ops.c and op.h.
@
text
@d1 1
a1 1
/*	$NetBSD$ */
d4 1
a4 1
/*	name	repr		b l i s a f v t b s l r p c e e q c	act */
d6 1
a6 1
op(	ARROW,	"->",		1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,	1)
d8 2
a9 2
op(	NOT,	"!",		0,1,0,1,0,1,0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1,0,0,0,0,0,1,0,0,	1)
op(	ORASS,	"|=",		1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,	1)
d55 4
a58 4
op(	CALL,	"call",		1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,	1)
op(	COMMA,	",",		1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,	1)
op(	CVT,	"convert",	0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,	1)
op(	ICALL,	"icall",	1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,	1)
d60 2
a61 2
op(	PUSH,	"push",		0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,	1)
op(	RETURN,	"return",	1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,	1)
d65 1
a65 1
op(	INIT,	"init",		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,	1)
d67 2
a68 2
op(	FARG,	"farg",		1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,	1)
/*	name	repr		b l i s a f v t b s l r p c e e q c	act */
@


1.6
log
@lint: clean up symbolic operator names that are used in the messages

Including the "p" in the symbolic operator names was questionable, for
several reasons:

1.  The "p" could be taken to mean an actual variable name, which is
    confusing if the function doesn't have such a variable, or even more
    so if the line contains an unrelated variable called "p".

2.  For the binary operators, having the "p" mentioned on both sides of
    the operator (such as in "p + p") wrongly suggested that both
    operands of the expression were the same.

3.  The name "p" often stands for a pointer.  Most of the operators
    don't accept pointers, therefore the name was misleading.

For these reasons, the "p" was removed from the symbolic name of all
operators.  This makes several pairs of operators indistinguishable:

    INCBEF == INCAFT
    DECBEF == DECAFT
    UPLUS == PLUS
    UMINUS == MINUS
    STAR == MULT
    AMPER == AND

This is not expected to create any confusion since C programmers are
expected to know these double meanings.

The symbolic names for SHLASS and SHRASS were missing the '=' before.
This was added since omitting it was probably an oversight.
@
text
@d1 77
a77 62
NOOP	no-op	0,0,0,0,0,0,0,0,0,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,0,0	1
NAME	name	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
CON	const	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
STRING	string	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
FSEL	fsel	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
CALL	call	1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0	1
COMMA	,	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0	1
CVT	convert	0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0	1
ICALL	icall	1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0	1
LOAD	load	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
PUSH	push	0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0	1
RETURN	return	1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0	1
REAL	real	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	0
IMAG	imag	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	0
INIT	init	1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0	1	pseudo
CASE	case	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	0	pseudo
FARG	farg	1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0	1	pseudo
@


1.5
log
@lint: swap columns 1 and 2 in ops.def

List the ID of a record first, followed by the describing fields.
@
text
@d6 28
a33 28
INC	p + 1	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	0
DEC	p - 1	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	0
INCBEF	++p	0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0	1
DECBEF	--p	0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0	1
INCAFT	p++	0,0,0,1,0,0,0,0,0,1,0,0,0,0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@


1.4
log
@lint: make generating the operators table simpler

The generated files are exactly the same as before.
@
text
@d1 62
a62 62
no-op	NOOP	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	0
->	ARROW	1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0	1
.	POINT	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
!	NOT	0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,0	1
~	COMPL	0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1	1
p + 1	INC	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	0
p - 1	DEC	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	0
++p	INCBEF	0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0	1
--p	DECBEF	0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0	1
p++	INCAFT	0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0	1
p--	DECAFT	0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0	1
+p	UPLUS	0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,0	1
-p	UMINUS	0,0,0,0,1,1,1,0,0,0,1,0,0,0,0,1,1,0	1
*p	STAR	0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0	1
&p	AMPER	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
p * p	MULT	1,0,0,0,1,1,1,0,1,0,0,1,0,0,0,1,1,0	1
p / p	DIV	1,0,0,0,1,1,1,0,1,0,1,1,0,0,0,1,1,0	1
p % p	MOD	1,0,1,0,0,1,1,0,1,0,1,1,0,0,0,1,1,0	1
p + p	PLUS	1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,1,0,0	1
p - p	MINUS	1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,1,0,0	1
p << p	SHL	1,0,1,0,0,1,1,0,0,0,0,0,1,0,0,1,1,0	1
p >>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0	1
p &= p	ANDASS	1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0	1
p ^= p	XORASS	1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0	1
p |= p	ORASS	1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0	1
n	NAME	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
const	CON	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
char *	STRING	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
fsel	FSEL	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
p()	CALL	1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0	1
,	COMMA	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0	1
(cast)p	CVT	0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0	1
icall	ICALL	1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0	1
load	LOAD	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	1
push	PUSH	0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0	1
return	RETURN	1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0	1
p.re	REAL	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	0
p.im	IMAG	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	0
p = {}	INIT	1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0	1	pseudo
case	CASE	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	0	pseudo
f(p)	FARG	1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0	1	pseudo
@


1.3
log
@lint: fix inconsistent whitespace in ops.def
@
text
@d1 62
a62 62
no-op	NOOP	X
->	ARROW	1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
.	POINT	1,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
p()	CALL	1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
,	COMMA	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,
(cast)p	CVT	0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
icall	ICALL	1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
load	LOAD	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
push	PUSH	0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
return	RETURN	1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,
p.re	REAL	X
p.im	IMAG	X
p = {}	INIT	1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,	pseudo
case	CASE	X	pseudo
f(p)	FARG	1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,	pseudo
@


1.2
log
@as promised make the last ops table auto-generated.
@
text
@d27 1
a27 1
p == p	EQ 	1,1,0,1,0,1,1,0,1,0,0,0,0,1,1,0,1,0,
d30 1
a30 1
p ^ p 	XOR 	1,0,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,
d43 1
a43 1
p >> p	SHRASS 	1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,
d48 1
a48 1
const	CON 	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@


1.2.2.1
log
@file ops.def was added on branch bouyer-quota2 on 2011-02-08 16:20:13 +0000
@
text
@d1 62
@


1.2.2.2
log
@Sync with HEAD
@
text
@a0 62
no-op	NOOP	X
->	ARROW	1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
.	POINT	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
!	NOT	0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,0,
~	COMPL	0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,
p + 1	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0,0,0,0,0,0,0,0,0,0,1,0,
(cast)p	CVT	0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
icall	ICALL	1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
load	LOAD	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
push	PUSH	0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
return	RETURN	1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,
p.re	REAL	X
p.im	IMAG	X
p = {}	INIT	1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,	pseudo
case	CASE	X	pseudo
f(p)	FARG	1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,	pseudo
@


1.1
log
@generate ops table dynamically. Will move the other table from tree.c there
too.
@
text
@d1 62
a62 62
no-op	NOOP
->	ARROW
.	POINT
!	NOT
~	COMPL
p + 1	INC
p - 1	DEC
++p	INCBEF
--p	DECBEF
p++	INCAFT
p--	DECAFT
+p	UPLUS
-p	UMINUS
*p	STAR
&	AMPER
p * p	MULT
p / p	DIV
p % p	MOD
p + p	PLUS
p - p	MINUS
p << p	SHL
p >> p	SHR
p < p	LT
p <= p	LE
p > p	GT
p >= p	GE
p == p	EQ
p != p	NE
p & p	AND
p ^ p 	XOR
p | p	OR
p && p	LOGAND
p || p	LOGOR
?	QUEST
:	COLON
p = p	ASSIGN
p *= p	MULASS
p /= p	DIVASS
p %= p	MODASS
p += p	ADDASS
p -= p	SUBASS
p << p	SHLASS
p >> p	SHRASS
p &= p	ANDASS
p ^= p	XORASS
p |= p	ORASS
n	NAME
const	CON
char *	STRING
fsel	FSEL
p()	CALL
,	COMMA
(cast)p	CVT
icall	ICALL
load	LOAD
push	PUSH
return	RETURN
p.re	REAL
p.im	IMAG
p = {}	INIT	/* pseudo op not used in trees */
case	CASE	/* pseudo op not used in trees */
f(p)	FARG	/* pseudo op not used in trees */
@

