xref: /netbsd-src/tests/usr.bin/xlint/lint1/lex_char_uchar.c (revision 867d70fc718005c0918b8b8b2f9d7f2d52d0a0db)
1 /*	$NetBSD: lex_char_uchar.c,v 1.4 2021/08/21 11:50:57 rillig Exp $	*/
2 # 3 "lex_char_uchar.c"
3 
4 /*
5  * Test lexical analysis of character constants on platforms where plain
6  * char has the same representation as unsigned char.
7  */
8 
9 /* lint1-only-if: uchar */
10 
11 /*
12  * Before inittyp.c 1.23 from 2021-06-29, the following initialization
13  * triggered a wrong warning "conversion of 'int' to 'char' is out of range",
14  * but only on platforms where char has the same representation as unsigned
15  * char.  There are only few of these platforms, which allowed this bug to
16  * survive for almost 26 years, since the initial commit of lint on
17  * 1995-07-03.
18  */
19 char ch = '\xff';
20