summaryrefslogtreecommitdiff
path: root/tests/usr.bin/xlint/lint1/msg_177.c
blob: d2ab8d2c10658b6ef3c58d908f025ad8b509202e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*	$NetBSD: msg_177.c,v 1.4 2023/03/28 14:44:35 rillig Exp $	*/
# 3 "msg_177.c"

// Test for message: non-constant initializer [177]

/* lint1-extra-flags: -X 351 */

extern int function(void);

static const int not_a_constant = 13;

/* expect+1: error: non-constant initializer [177] */
const int var = not_a_constant;

/* expect+1: error: non-constant initializer [177] */
const int calling_function = function();