File: strings.c

package info (click to toggle)
sdcc 4.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 112,804 kB
  • sloc: ansic: 622,685; cpp: 259,454; makefile: 81,253; sh: 40,203; asm: 19,222; perl: 12,139; yacc: 7,761; awk: 3,378; lisp: 1,677; python: 1,097; lex: 1,028; sed: 76
file content (41 lines) | stat: -rw-r--r-- 1,260 bytes parent folder | download | duplicates (3)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <wchar.h>
#include <uchar.h>

// Concatenation of string literals, some prefixed, all prefixed ones have same prefix. Allowed.
#ifdef TEST1
const char *str1 = u8"testu8" "test" u8"testu8";
const char *str2 = u8"testu8" u8"testu8";
const char *str3 = u8"testu8" u8"testu8" u8"testu8";
const char16_t *str4 = u"testu8" "test";
const char32_t *str5 = U"testu8" "test";
#endif

// Concatenation of string literals, some prefixed, prefixed have different prefixes. Implementation-defined in C11, C17. Requires diagnostic in C23.
#ifdef TEST2
const char *str1 = u8"testu8" "test" u"testu"; /* WARNING(SDCC) */ /* IGNORE(GCC) */
#endif

#ifdef TEST3
const char *str1 = u8"testu8" "test" L"testL"; /* WARNING(SDCC) */ /* IGNORE(GCC) */
#endif

#ifdef TEST4
const char *str1 = L"testuL" "test" u"testu"; /* WARNING(SDCC) */ /* IGNORE(GCC) */
#endif

#ifdef TEST5
const char32_t *str1 = U"testU" "test" u"testu"; /* WARNING(SDCC) */ /* IGNORE(GCC) */
#endif

#ifdef TEST6
const char32_t *str1 = U"testU" u"testu"; /* WARNING(SDCC) */ /* IGNORE(GCC) */
#endif

#ifdef TEST7
const char32_t *str1 = U"testU" L"testL"; /* WARNING(SDCC) */ /* IGNORE(GCC) */
#endif

#ifdef TEST8
const wchar_t *str1 = L"testL" u"testu"; /* WARNING(SDCC) */ /* IGNORE(GCC) */
#endif