Add a comment in init.h to remind devs to update makedoc.c when adding
a new type.
Change makedoc to fail on a missing type. Otherwise it's too easy to
miss the resulting problem in the documentation.
Credit goes to Eike Rathke for noting that it was too easy to forget
to do this, and something should be fixed. I found his solution a bit
too complicated though, and opted for just adding comment and program
failure.
for (type = DT_NONE; types[type].machine; type++)
if (!strcmp (types[type].machine, s))
return type;
-
- return DT_NONE;
+
+ fprintf (stderr, "%s: Unknown type %s. Please update makedoc.c\n",
+ Progname, s);
+ exit (1);
}
static const char *type2human (int type)
#include "buffy.h"
#ifndef _MAKEDOC
+/* If you add a data type, be sure to update doc/makedoc.c */
#define DT_MASK 0x0f
#define DT_BOOL 1 /* boolean option */
#define DT_NUM 2 /* a number (short) */