Also, the warning being that "expects int, but type is wchar_t"... no, type
is not wchar_t. Type is probably long. Specify the ACTUAL TYPE, not the random
typedef alias for it. If the translated type _did_ match, there wouldn't
be a warning! (This is why c89 promoted all arguments to int, precisely
so this wasn't a problem.)
// encode back to utf8, something is wrong with your libc. But just
// in case somebody finds an exploit...
len = wcrtomb(new, c, 0);
- if (len < 1) error_exit("bad utf8 %x", c);
+ if (len < 1) error_exit("bad utf8 %x", (int)c);
new += len;
}
}
sprintf(to, "*.*L%c", c);
printf(toybuf, wp[0], wp[1], ld);
- } else error_exit("bad %%%c@%ld", c, f-*toys.optargs);
+ } else error_exit("bad %%%c@%ld", c, (long)(f-*toys.optargs));
if (end && (errno || *end)) perror_msg("bad %%%c %s", c, aa);
}
brand:
// Reminisce about chestnut trees.
- error_exit("bad pattern '%s'@%ld (%c)", errstart, line-errstart+1, *line);
+ error_exit("bad pattern '%s'@%ld (%c)", errstart, line-errstart+1L, *line);
}
void sed_main(void)