summaryrefslogtreecommitdiff
path: root/regress/usr.bin/xlint/test-12.c
blob: 11a43e842357c2abaeab1e9650fa97b5a982beec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*	$OpenBSD: test-12.c,v 1.1 2005/12/09 04:30:58 cloder Exp $	*/

/*
 * Placed in the public domain by Chad Loder <cloder@openbsd.org>.
 *
 * Test lint warnings regarding assignment in conditional context.
 */
#include <limits.h>

/* ARGSUSED */
int
main(int argc, char *argv[])
{
	int a = 0;

	if (a = argc)		/* should warn */
		return 1;

	a++;

	if ((a = argc))		/* should not warn */
		return 1;

	return 0;
}