diff --git a/usr.bin/xlint/lint1/decl.c b/usr.bin/xlint/lint1/decl.c index 1d61406354e6..827a4d91d8fc 100644 --- a/usr.bin/xlint/lint1/decl.c +++ b/usr.bin/xlint/lint1/decl.c @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.67 2016/12/27 21:52:35 christos Exp $ */ +/* $NetBSD: decl.c,v 1.68 2017/03/06 23:04:52 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.67 2016/12/27 21:52:35 christos Exp $"); +__RCSID("$NetBSD: decl.c,v 1.68 2017/03/06 23:04:52 christos Exp $"); #endif #include @@ -256,7 +256,7 @@ addtype(type_t *tp) tspec_t t; #ifdef DEBUG char buf[1024]; - printf("addtype %s\n", tyname(buf, sizeof(buf), tp)); + printf("%s: %s\n", __func__, tyname(buf, sizeof(buf), tp)); #endif if (tp->t_typedef) { if (dcs->d_type != NULL || dcs->d_atyp != NOTSPEC || @@ -355,6 +355,8 @@ addtype(type_t *tp) dcs->d_terr = 1; dcs->d_atyp = t; } + } else if (t == PTR) { + dcs->d_type = tp; } else { /* * remember specifiers "void", "char", "int", @@ -727,6 +729,10 @@ deftyp(void) tp = dcs->d_type; scl = dcs->d_scl; +#ifdef DEBUG + char buf[1024]; + printf("%s: %s\n", __func__, tyname(buf, sizeof(buf), tp)); +#endif if (t == NOTSPEC && s == NOTSPEC && l == NOTSPEC && c == NOTSPEC && tp == NULL) dcs->d_notyp = 1;