* Copyright 2019 Philippe Proulx <pproulx@efficios.com>
*/
-#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#define argpar_calloc(_type, _nmemb) ((_type *) calloc((_nmemb), sizeof(_type)))
#define argpar_zalloc(_type) argpar_calloc(_type, 1)
-#define ARGPAR_ASSERT(_cond) assert(_cond)
+#define ARGPAR_ASSERT(_cond) ((void) sizeof((void) (_cond), 0))
#ifdef __MINGW_PRINTF_FORMAT
# define ARGPAR_PRINTF_FORMAT __MINGW_PRINTF_FORMAT
opt_arg = next_orig_arg;
used_next_orig_arg = true;
}
+ } else if (eq_pos) {
+ /*
+ * Unexpected `--opt=arg` style for a long option which
+ * doesn't accept an argument.
+ */
+ argpar_string_append_printf(error,
+ "Unexpected argument for option `--%s`",
+ long_opt_name);
+ goto error;
}
/* Create and append option argument */