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 allow c9x struct casts (in new libXt)



details:   https://anonhg.NetBSD.org/src/rev/bf478b3c9ce7
branches:  trunk
changeset: 457697:bf478b3c9ce7
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jul 12 23:32:45 2019 +0000

description:
allow c9x struct casts (in new libXt)

diffstat:

 usr.bin/xlint/lint1/tree.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 48a8e40c7ff1 -r bf478b3c9ce7 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Fri Jul 12 22:45:07 2019 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Fri Jul 12 23:32:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.86 2018/09/07 15:16:15 christos Exp $       */
+/*     $NetBSD: tree.c,v 1.87 2019/07/12 23:32:45 christos Exp $       */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.86 2018/09/07 15:16:15 christos Exp $");
+__RCSID("$NetBSD: tree.c,v 1.87 2019/07/12 23:32:45 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -3199,8 +3199,10 @@
                return NULL;
        } else if (nt == STRUCT || nt == ARRAY || nt == FUNC) {
                /* invalid cast expression */
-               error(147);
-               return (NULL);
+               if (!Sflag || nt == ARRAY || nt == FUNC) {
+                       error(147);
+                       return (NULL);
+               }
        } else if (ot == STRUCT || ot == UNION) {
                /* invalid cast expression */
                error(147);



Home | Main Index | Thread Index | Old Index