There's just one, in show_product().
Use new BUILD_ASSERT() there, because its contract is even simpler
than BUILD_ASSERT_ONE()'s.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
#define BUILD_ASSERT_ONE(cond) \
(sizeof(char[1 - 2 * !(cond)]))
+/*
+ * Assert constant expression @cond.
+ * If @cond is zero, force a compilation error.
+ */
+#define BUILD_ASSERT(cond) \
+ ((void)BUILD_ASSERT_ONE(cond))
+
void exit_nomem(void) ATTRIBUTE((noreturn));
/* return codes from command routines */
pp->p_sname,
pp->p_type < 0 ? ' ' : ichr[pp->p_type].i_mnem,
pp->p_cost);
- (void)CANT_HAPPEN(MAXPRCON > 3); /* output has only three columns */
+ BUILD_ASSERT(MAXPRCON <= 3); /* output has only three columns */
for (i = 0; i < 3; i++) {
if (i < MAXPRCON && pp->p_camt[i]
&& pp->p_ctype[i] > I_NONE && pp->p_ctype[i] <= I_MAX)