Re: [PATCH 1/2] Fix C/107926: Wrong error message when initializing char array

2023-04-30 Thread Jeff Law via Gcc-patches
On 11/30/22 10:18, apinski--- via Gcc-patches wrote: From: Andrew Pinski The problem here is the code which handles {"a"} is supposed to handle the case where the is something after the string but it only handles the case where there is another string so we go down the other path and error o

Re: [PATCH 1/2] Fix C/107926: Wrong error message when initializing char array

2022-11-30 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 30, 2022 at 09:18:14AM -0800, apinski--- via Gcc-patches wrote: > gcc/c/ChangeLog: > > PR c/107926 > * c-typeck.cc (process_init_element): > Move the ceck for string cst until > after the error message. Just a ChangeLog nit, not a patch review for which I defer

[PATCH 1/2] Fix C/107926: Wrong error message when initializing char array

2022-11-30 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is the code which handles {"a"} is supposed to handle the case where the is something after the string but it only handles the case where there is another string so we go down the other path and error out saying "excess elements in struct initializer" even tho