From: Alejandro Colomar <alx@kernel.org>
To: Martin Uecker <muecker@gwdg.de>
Cc: David Malcolm <dmalcolm@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH v2] C, ObjC: Add -Wunterminated-string-initialization
Date: Sun, 1 Oct 2023 13:35:12 +0200 [thread overview]
Message-ID: <emodvb3pcyms5a74dhzk6vk3yb6m4spf6gwahnz6p3qa3qknpo@vupkp3qz2wbd> (raw)
In-Reply-To: <bc5e88387ae14024926b14e9e649f84629f0b745.camel@gwdg.de>
[-- Attachment #1: Type: text/plain, Size: 1662 bytes --]
On Sun, Oct 01, 2023 at 09:37:59AM +0200, Martin Uecker wrote:
>
> (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?
Makes sense.
Here's the output after a fix (which I'll send soon as a new revision):
```
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-initialization]
```
and
```
=== gcc Summary ===
# of expected passes 2
```
The only thing that concerns me a little bit is that I don't see any
PASS (or XFAIL).
> You should see an additional FAIL for an excess warning.
Yep, I did.
Cheers,
Alex
>
> Martin
>
>
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-10-01 11:35 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
2023-10-01 11:35 ` Alejandro Colomar [this message]
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=emodvb3pcyms5a74dhzk6vk3yb6m4spf6gwahnz6p3qa3qknpo@vupkp3qz2wbd \
--to=alx@kernel.org \
--cc=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=muecker@gwdg.de \
/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).