This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C PATCH to fix ICE with -Wformat and zero-length array (PR c/80919)


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[1]".
> 
> Bootstrapped/regtested on x86_64-linux, ok for trunk/7?
> 
> 2017-06-02  Marek Polacek  <polacek@redhat.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.

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]