allow c9x struct casts (in new libXt)
This commit is contained in:
parent
a8a9d504b1
commit
a713a1068c
|
@ -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
|
* Copyright (c) 1994, 1995 Jochen Pohl
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#if defined(__RCSID) && !defined(lint)
|
#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
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -3199,8 +3199,10 @@ cast(tnode_t *tn, type_t *tp)
|
||||||
return NULL;
|
return NULL;
|
||||||
} else if (nt == STRUCT || nt == ARRAY || nt == FUNC) {
|
} else if (nt == STRUCT || nt == ARRAY || nt == FUNC) {
|
||||||
/* invalid cast expression */
|
/* invalid cast expression */
|
||||||
error(147);
|
if (!Sflag || nt == ARRAY || nt == FUNC) {
|
||||||
return (NULL);
|
error(147);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
} else if (ot == STRUCT || ot == UNION) {
|
} else if (ot == STRUCT || ot == UNION) {
|
||||||
/* invalid cast expression */
|
/* invalid cast expression */
|
||||||
error(147);
|
error(147);
|
||||||
|
|
Loading…
Reference in New Issue