Re: [PATCH] c++: Avoid narrowing in make_char_string_pack

2022-01-03 Thread Marek Polacek via Gcc-patches
On Sat, Dec 18, 2021 at 07:43:55PM -0500, Eric Gallager wrote: > On Fri, Dec 17, 2021 at 5:59 PM Marek Polacek via Gcc-patches > wrote: > > > > This fixes > > > > gcc/cp/parser.c:4618:41: warning: narrowing conversion of '(char)(*(str + > > ((sizetype)i)))' from 'char' to 'unsigned char'

Re: [PATCH] c++: Avoid narrowing in make_char_string_pack

2021-12-20 Thread Jason Merrill via Gcc-patches
On 12/17/21 17:58, Marek Polacek wrote: This fixes gcc/cp/parser.c:4618:41: warning: narrowing conversion of '(char)(*(str + ((sizetype)i)))' from 'char' to 'unsigned char' [-Wnarrowing] 4618 | unsigned char s[3] = { '\'', str[i], '\'' }; |

Re: [PATCH] c++: Avoid narrowing in make_char_string_pack

2021-12-18 Thread Eric Gallager via Gcc-patches
On Fri, Dec 17, 2021 at 5:59 PM Marek Polacek via Gcc-patches wrote: > > This fixes > > gcc/cp/parser.c:4618:41: warning: narrowing conversion of '(char)(*(str + > ((sizetype)i)))' from 'char' to 'unsigned char' [-Wnarrowing] > 4618 | unsigned char s[3] = { '\'', str[i], '\'' }; > |

[PATCH] c++: Avoid narrowing in make_char_string_pack

2021-12-17 Thread Marek Polacek via Gcc-patches
This fixes gcc/cp/parser.c:4618:41: warning: narrowing conversion of '(char)(*(str + ((sizetype)i)))' from 'char' to 'unsigned char' [-Wnarrowing] 4618 | unsigned char s[3] = { '\'', str[i], '\'' }; |~^ Bootstrapped/regtested on