]> git.draconx.ca Git - cdecl99.git/blobdiff - src/explain.c
Add support for empty declarators.
[cdecl99.git] / src / explain.c
index 6ab2796acbcc812cbfbccea87cac15480e0e1a20..002b85702104b7068fb63d5e558f54955ef0fc09 100644 (file)
@@ -175,8 +175,11 @@ static size_t
 explain_prologue(char *buf, size_t n, struct cdecl_declarator *d)
 {
        while (d) {
-               if (d->type == CDECL_DECL_IDENT)
+               if (d->type == CDECL_DECL_IDENT) {
+                       if (!d->u.ident)
+                               return snprintf(buf, n, "type");
                        return snprintf(buf, n, "declare %s as", d->u.ident);
+               }
                d = next_declarator(d);
        }
 }