assert prints helpful context info to stderr. These cases should never
be reached except by programmer error.
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <assert.h>
+
#include "cdecl.h"
#include "typemap.h"
case CDECL_STOR_REGISTER:
return "register";
default:
- abort();
+ assert(0);
}
}
case CDECL_DECL_ARRAY:
return d->u.array.declarator;
default:
- abort();
+ assert(0);
}
}
case CDECL_DECL_ARRAY:
return ret + explain_array(buf, n, &d->u.array);
default:
- abort();
+ assert(0);
}
}
fprintf(stderr, "only function declarations may have function specifiers.\n");
return -1;
default:
- abort();
+ assert(0);
}
}
%locations
%{
+#include <assert.h>
+
#include "scan.h"
#include "cdecl.h"
free_declarator(x->u.array.declarator);
break;
default:
- abort();
+ assert(0);
}
free(x);
x = p;