Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: add reminder that C99 does not all...



details:   https://anonhg.NetBSD.org/src/rev/cf64727a741f
branches:  trunk
changeset: 953743:cf64727a741f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Mar 19 07:54:13 2021 +0000

description:
lint: add reminder that C99 does not allow '{}' in initializer

No functional change.

diffstat:

 usr.bin/xlint/lint1/cgram.y |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 14ccba621c17 -r cf64727a741f usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Fri Mar 19 07:51:33 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Fri Mar 19 07:54:13 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.177 2021/03/19 00:55:02 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.178 2021/03/19 07:54:13 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.177 2021/03/19 00:55:02 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.178 2021/03/19 07:54:13 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -1333,7 +1333,9 @@
          expr                          %prec T_COMMA {
                init_using_expr($1);
          }
-       | init_lbrace init_rbrace
+       | init_lbrace init_rbrace {
+               /* XXX: Empty braces are not covered by C99 6.7.8. */
+         }
        | init_lbrace init_expr_list init_rbrace
        | init_lbrace init_expr_list T_COMMA init_rbrace
        | error



Home | Main Index | Thread Index | Old Index