public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Uecker <muecker@gwdg.de>
To: Alejandro Colomar <alx@kernel.org>, David Malcolm <dmalcolm@redhat.com>
Cc: <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH v2] C, ObjC: Add -Wunterminated-string-initialization
Date: Sun, 1 Oct 2023 09:37:59 +0200	[thread overview]
Message-ID: <bc5e88387ae14024926b14e9e649f84629f0b745.camel@gwdg.de> (raw)
In-Reply-To: <2ovxkeqosz3c7wtk4mkfvkkp66prki5o4zicz6rcmwx4ajsci6@qm3bkfiqvh6a>


(I shortened the recipient list)

Am Sonntag, dem 01.10.2023 um 02:55 +0200 schrieb Alejandro Colomar:

> > 
...
> I ran the tests, and get some unexpected failure.  I used dg-warning,
> but maybe I used it wrong?  Here's the output:
> 
> ```
> output is:
> /home/alx/src/gnu/gcc/wustr/gcc/testsuite/gcc.dg/Wunterminated-string-initialization.c:5:14: warning: initializer-string for array of 'char' is too long [-Wunterminated-string-initi
> alization]
> 
> FAIL: gcc.dg/Wunterminated-string-initialization.c  (test for warnings, line 5)
> ```
> 
> And here's the test:
> 
> ```
> /* { dg-do compile } */
> /* { dg-options "-Wunterminated-string-initialization" } */
> 
> char a1[] = "a";
> char a2[1] = "a";	/* { dg-warning "unterminated char sequence" } */
> char a3[2] = "a";
> ```
> 
> Why isn't it expecting the warning?

Because the text does not match the actual output above?
You should see an additional FAIL for an excess warning.

Martin





  reply	other threads:[~2023-10-01  7:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 13:39 Alejandro Colomar
2023-03-24 14:53 ` David Malcolm
2023-03-24 17:45   ` Alejandro Colomar
2023-03-24 17:58     ` David Malcolm
2023-04-20 17:17       ` Ping: " Alejandro Colomar
2023-10-01  0:55   ` Alejandro Colomar
2023-10-01  7:37     ` Martin Uecker [this message]
2023-10-01 11:35       ` Alejandro Colomar
2023-10-01 11:38       ` [PATCH v3] " Alejandro Colomar
2023-10-01 11:41       ` [PATCH v4] " Alejandro Colomar
2023-10-01 16:24       ` [PATCH v5] " Alejandro Colomar
2023-10-08 13:05         ` Ping: " Alejandro Colomar
2023-11-13  9:55         ` Alejandro Colomar
2024-02-06 10:45       ` [PATCH v5 RESEND] " Alejandro Colomar
2024-02-25 18:10         ` Mike Stump
2024-02-25 19:44           ` Alejandro Colomar
2024-02-26 15:27             ` Joseph Myers
2024-02-26 15:24           ` Joseph Myers
2024-02-26 15:56             ` Alejandro Colomar
2024-02-26 16:19               ` Joseph Myers
2024-02-26 19:54                 ` Sandra Loosemore
2024-02-26 19:32               ` Mike Stump
2024-03-05 20:20                 ` [PATCH v6] " Alejandro Colomar
2024-03-05 20:25                   ` Alejandro Colomar
2024-03-05 20:33                 ` [PATCH v7] " Alejandro Colomar
2024-03-05 22:42                   ` Sandra Loosemore
2024-03-06 18:43                 ` [PATCH v8] " Alejandro Colomar
2024-05-14 18:16                   ` Alejandro Colomar

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=bc5e88387ae14024926b14e9e649f84629f0b745.camel@gwdg.de \
    --to=muecker@gwdg.de \
    --cc=alx@kernel.org \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.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).