public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: apinski@marvell.com, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 2/2] Improve error message for excess elements in array initializer from {"a"}
Date: Wed, 30 Nov 2022 17:31:13 -0600	[thread overview]
Message-ID: <20221130233113.GU25951@gate.crashing.org> (raw)
In-Reply-To: <87edtk2fsl.fsf@igel.home>

On Thu, Dec 01, 2022 at 12:17:30AM +0100, Andreas Schwab wrote:
> On Nov 30 2022, Segher Boessenkool wrote:
> 
> > char u[1] = { "x", "x" }; /* { dg-error {excess elements in 'char[1]' initializer} } */
> 
> That won't work, as '[1]' is a bracket expression only matching '1'.
> You'll need {... 'char\[1\]' ...}.

Heh.  Yeah, char\[1].  Sorry.


Segher

  reply	other threads:[~2022-11-30 23:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 17:18 [PATCH 1/2] Fix C/107926: Wrong error message when initializing char array apinski
2022-11-30 17:18 ` [PATCH 2/2] Improve error message for excess elements in array initializer from {"a"} apinski
2022-11-30 23:05   ` Segher Boessenkool
2022-11-30 23:17     ` Andreas Schwab
2022-11-30 23:31       ` Segher Boessenkool [this message]
2023-04-30 16:24   ` Jeff Law
2022-11-30 17:29 ` [PATCH 1/2] Fix C/107926: Wrong error message when initializing char array Jakub Jelinek
2023-04-30 16:23 ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221130233113.GU25951@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=apinski@marvell.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).