[prev in list] [next in list] [prev in thread] [next in thread]
List: gcc-patches
Subject: Re: [PATCH 2/2] Improve error message for excess elements in array initializer from {"a"}
From: Jeff Law via Gcc-patches <gcc-patches () gcc ! gnu ! org>
Date: 2023-04-30 16:24:17
Message-ID: 459b385d-3799-7482-a7ce-6c36952709f1 () gmail ! com
[Download RAW message or body]
On 11/30/22 10:18, apinski--- via Gcc-patches wrote:
> From: Andrew Pinski <apinski@marvell.com>
>
> So char arrays are not the only type that be initialized from {"a"}.
> We can have wchar_t (L"") and char16_t (u"") types too. So let's
> print out the type of the array instead of just saying char.
>
> Note in the testsuite I used regex . to match '[' and ']' as
> I could not figure out how many '\' I needed.
>
> OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
>
> gcc/c/ChangeLog:
>
> * c-typeck.cc (process_init_element): Print out array type
> for excessive elements.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.dg/init-bad-1.c: Update error message.
> * gcc.dg/init-bad-2.c: Likewise.
> * gcc.dg/init-bad-3.c: Likewise.
> * gcc.dg/init-excess-3.c: Likewise.
> * gcc.dg/pr61096-1.c: Likewise.
OK
jeff
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic