This is the mail archive of the
mailing list for the GCC project.
Re: C PATCH to fix ICE with -Wformat and zero-length array (PR c/80919)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Malcolm <dmalcolm at redhat dot com>
- Date: Fri, 2 Jun 2017 19:50:59 +0000
- Subject: Re: C PATCH to fix ICE with -Wformat and zero-length array (PR c/80919)
- Authentication-results: sourceware.org; auth=none
- References: <20170602171912.GH3413@redhat.com>
On Fri, 2 Jun 2017, Marek Polacek wrote:
> In the C FE, zero-length arrays require structural equality, so we can't
> compare their canonical types, 'cause they're NULL. But matching_type_p didn't
> know that so we were crashing. With this patch the ICE is gone and the warning
> messages are the same as with e.g. "int a".
> Bootstrapped/regtested on x86_64-linux, ok for trunk/7?
> 2017-06-02 Marek Polacek <email@example.com>
> PR c/80919
> * c-format.c (matching_type_p): Return false if any of the types
> requires structural equality.
> * gcc.dg/format/pr80919.c: New test.
Joseph S. Myers