From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 0A03A3858D1E for ; Wed, 30 Nov 2022 23:06:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0A03A3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 2AUN574S016267; Wed, 30 Nov 2022 17:05:07 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 2AUN56Uv016266; Wed, 30 Nov 2022 17:05:06 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 30 Nov 2022 17:05:06 -0600 From: Segher Boessenkool To: apinski@marvell.com Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 2/2] Improve error message for excess elements in array initializer from {"a"} Message-ID: <20221130230506.GS25951@gate.crashing.org> References: <1669828695-18532-1-git-send-email-apinski@marvell.com> <1669828695-18532-2-git-send-email-apinski@marvell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1669828695-18532-2-git-send-email-apinski@marvell.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_SHORT,KAM_TK,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi! On Wed, Nov 30, 2022 at 09:18:15AM -0800, apinski--- via Gcc-patches wrote: > Note in the testsuite I used regex . to match '[' and ']' as > I could not figure out how many '\' I needed. Don't use double quotes then :-) Inside double quotes all of command substitution, variable substitution, and backslash substitution are performed. In a regexp you typically want none of this. You usually do want the whitespace to be significant, so it is good to quote it in braces though (unless you like quoting all your whitespace). > -char u[1] = { "x", "x" }; /* { dg-error "excess elements in 'char' array initializer" } */ > +char u[1] = { "x", "x" }; /* { dg-error "excess elements in 'char.1.' initializer" } */ char u[1] = { "x", "x" }; /* { dg-error {excess elements in 'char[1]' initializer} } */ See for a very short page that has *all* Tcl syntax! Segher