- const struct variable *var;
- struct prt_out_spec *spec;
-
- var = vars[var_idx++];
- if (!fmt_check_width_compat (f, var_get_width (var)))
- return false;
-
- spec = pool_alloc (trns->pool, sizeof *spec);
- spec->type = PRT_VAR;
- spec->record = *record;
- spec->first_column = *column;
- spec->var = var;
- spec->format = *f;
- spec->add_space = add_space;
-
- /* This is a completely bizarre twist for compatibility:
- WRITE outputs the system-missing value as a field
- filled with spaces, instead of using the normal format
- that usually contains a period. */
- spec->sysmis_as_spaces = (which_formats == WRITE
- && var_is_numeric (var)
- && (fmt_get_category (spec->format.type)
- != FMT_CAT_BINARY));
-
+ const struct variable *var = vars[var_idx++];
+ char *error = fmt_check_width_compat__ (f, var_get_name (var),
+ var_get_width (var));
+ if (error)
+ {
+ lex_ofs_error (lexer, formats_start, formats_end, "%s", error);
+ free (error);
+ return false;
+ }
+
+ struct prt_out_spec *spec = pool_alloc (trns->pool, sizeof *spec);
+ *spec = (struct prt_out_spec) {
+ .type = PRT_VAR,
+ .record = *record,
+ .first_column = *column,
+ .var = var,
+ .format = *f,
+ .add_space = add_space,
+
+ /* This is a completely bizarre twist for compatibility: WRITE
+ outputs the system-missing value as a field filled with spaces,
+ instead of using the normal format that usually contains a
+ period. */
+ .sysmis_as_spaces = (which_formats == WRITE
+ && var_is_numeric (var)
+ && (fmt_get_category (f->type)
+ != FMT_CAT_BINARY)),
+ };