summaryrefslogtreecommitdiff
path: root/tests/usr.bin/xlint/lint1/msg_275.c
blob: 18e1468488ce890d12b68f0a58d3fae068676ce6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*	$NetBSD: msg_275.c,v 1.6 2023/07/07 19:45:22 rillig Exp $	*/
# 3 "msg_275.c"

// Test for message: cast discards 'const' from type '%s' [275]

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

char *
unconst_string(const char *s)
{
	/* expect+1: warning: cast discards 'const' from type 'pointer to const char' [275] */
	return (char *)s;
}

const char *
const_string(char *s)
{
	return (const char *)s;
}