| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: lex_char.c,v 1.4 2021/06/29 07:28:01 rillig Exp $ */ | | 1 | /* $NetBSD: lex_char.c,v 1.5 2022/04/01 21:12:42 rillig Exp $ */ |
2 | # 3 "lex_char.c" | | 2 | # 3 "lex_char.c" |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Tests for lexical analysis of character constants. | | 5 | * Tests for lexical analysis of character constants. |
6 | * | | 6 | * |
7 | * C99 6.4.4.4 "Character constants" | | 7 | * C99 6.4.4.4 "Character constants" |
8 | */ | | 8 | */ |
9 | | | 9 | |
10 | void sink(char); | | 10 | void sink(char); |
11 | | | 11 | |
12 | void | | 12 | void |
13 | test(void) | | 13 | test(void) |
14 | { | | 14 | { |
| @@ -50,22 +50,24 @@ test(void) | | | @@ -50,22 +50,24 @@ test(void) |
50 | sink('\n'); | | 50 | sink('\n'); |
51 | | | 51 | |
52 | /* U+000B vertical tabulation */ | | 52 | /* U+000B vertical tabulation */ |
53 | sink('\v'); | | 53 | sink('\v'); |
54 | | | 54 | |
55 | /* U+000C form feed */ | | 55 | /* U+000C form feed */ |
56 | sink('\f'); | | 56 | sink('\f'); |
57 | | | 57 | |
58 | /* U+000D carriage return */ | | 58 | /* U+000D carriage return */ |
59 | sink('\r'); | | 59 | sink('\r'); |
60 | } | | 60 | } |
61 | | | 61 | |
62 | /* | | 62 | /* |
63 | * Even though backslash-newline is not supported by C99, lint accepts it | | 63 | * The sequence backslash-newline is handled in an early stage of |
64 | * in any mode, even for traditional C. | | 64 | * translation (C90 5.1.1.2 item 2, C99 5.1.1.2 item 2, C11 5.1.1.2 item 2), |
| | | 65 | * which allows it in character literals as well. This doesn't typically |
| | | 66 | * occur in practice though. |
65 | */ | | 67 | */ |
66 | char ch = '\ | | 68 | char ch = '\ |
67 | \ | | 69 | \ |
68 | \ | | 70 | \ |
69 | \ | | 71 | \ |
70 | \ | | 72 | \ |
71 | x'; | | 73 | x'; |