python/hypothesis: update to 6.122.3
[oi-userland.git] / components / developer / gcc-14 / patches / 0035-16768-kernel-printf-should-know-about-j-and-z-size-s.patch
blob9a3ca68ff6d5f912e8562c462bfac5330ff7f0e9
1 From c774b68ffb026af9bbc0222c34158ff4eb72c5be Mon Sep 17 00:00:00 2001
2 From: Andy Fiddaman <illumos@fiddaman.net>
3 Date: Tue, 15 Oct 2024 15:31:19 +0000
4 Subject: 16768 kernel printf should know about %j and %z size
5 specifiers
7 ---
8 gcc/config/sol2-c.cc | 9 +++++----
9 gcc/testsuite/gcc.dg/format/cmn-err-1.c | 4 ++++
10 2 files changed, 9 insertions(+), 4 deletions(-)
12 diff --git a/gcc/config/sol2-c.cc b/gcc/config/sol2-c.cc
13 index c84c1369b891..9fa31b96ddc8 100644
14 --- a/gcc/config/sol2-c.cc
15 +++ b/gcc/config/sol2-c.cc
16 @@ -37,6 +37,8 @@ static const format_length_info cmn_err_length_specs[] =
18 { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99, 0 },
19 { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C89, 0 },
20 + { "j", FMT_LEN_j, STD_C99, NO_FMT, 0 },
21 + { "z", FMT_LEN_z, STD_C99, NO_FMT, 0 },
22 { NO_FMT, NO_FMT, 0 }
25 @@ -63,10 +65,9 @@ static const format_char_info bitfield_string_type =
26 static const format_char_info cmn_err_char_table[] =
28 /* none hh h l ll L z t j H D DD */
29 - /* C89 conversion specifiers. */
30 - { "dD", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN , BADLEN, BADLEN, BADLEN }, "-wp0", "", NULL },
31 - { "oOxX",0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN , BADLEN, BADLEN, BADLEN }, "-wp0", "", NULL },
32 - { "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN , BADLEN, BADLEN, BADLEN }, "-wp0", "", NULL },
33 + { "dD", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, BADLEN, T99_IM , BADLEN, BADLEN, BADLEN }, "-wp0", "", NULL },
34 + { "oOxX",0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, BADLEN, T99_ST, BADLEN, T99_UIM, BADLEN, BADLEN, BADLEN }, "-wp0", "", NULL },
35 + { "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, BADLEN, T99_ST, BADLEN, T99_UIM, BADLEN, BADLEN, BADLEN }, "-wp0", "", NULL },
36 { "c", 0, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN , BADLEN, BADLEN, BADLEN }, "-w", "", NULL },
37 { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN , BADLEN, BADLEN, BADLEN }, "-w", "c", NULL },
38 { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN , BADLEN, BADLEN, BADLEN }, "-wp", "cR", NULL },
39 diff --git a/gcc/testsuite/gcc.dg/format/cmn-err-1.c b/gcc/testsuite/gcc.dg/format/cmn-err-1.c
40 index f6833c1723ad..cbb4a1f927c3 100644
41 --- a/gcc/testsuite/gcc.dg/format/cmn-err-1.c
42 +++ b/gcc/testsuite/gcc.dg/format/cmn-err-1.c
43 @@ -19,6 +19,8 @@ int main()
44 llong ll = 3;
45 char hh = 4;
46 short h = 5;
47 + size_t z = 6;
48 + uintmax_t j = 7;
50 cmn_err_func (0, "%s", string);
51 cmn_err_func (0, "%d %D %o %O %x %X %u", i, i, i, i, i, i, i);
52 @@ -28,6 +30,8 @@ int main()
53 cmn_err_func (0, "%hd %hD %ho %hO %hx %hX %hu", h, h, h, h, h, h, h);
54 cmn_err_func (0, "%hhd %hhD %hho %hhO %hhx %hhX %hhu",
55 hh, hh, hh, hh, hh, hh, hh);
56 + cmn_err_func (0, "%jd %jD %jo %jO %jx %jX %ju", j, j, j, j, j, j, j);
57 + cmn_err_func (0, "%zd %zD %zo %zO %zx %zX %zu", z, z, z, z, z, z, z);
58 cmn_err_func (0, "%b %s", i, "\01Foo", string);
59 cmn_err_func (0, "%p", string);
60 cmn_err_func (0, "%16b", i, "\01Foo");