Use __attribute__ ((format)) where possible and fix issues found by it
parent
62e1cba691
commit
aca77e8410
|
@ -26,7 +26,7 @@ struct apk_url_print {
|
||||||
void apk_url_parse(struct apk_url_print *, const char *);
|
void apk_url_parse(struct apk_url_print *, const char *);
|
||||||
|
|
||||||
#define URL_FMT "%.*s%s%s"
|
#define URL_FMT "%.*s%s%s"
|
||||||
#define URL_PRINTF(u) u.len_before_pw, u.url, u.pwmask, u.url_or_host
|
#define URL_PRINTF(u) (int)u.len_before_pw, u.url, u.pwmask, u.url_or_host
|
||||||
|
|
||||||
struct apk_out {
|
struct apk_out {
|
||||||
int verbosity;
|
int verbosity;
|
||||||
|
@ -48,7 +48,8 @@ static inline int apk_out_verbosity(struct apk_out *out) { return out->verbosity
|
||||||
#define apk_dbg2(out, args...) do { if (apk_out_verbosity(out) >= 3) { apk_out_fmt(out, NULL, args); } } while (0)
|
#define apk_dbg2(out, args...) do { if (apk_out_verbosity(out) >= 3) { apk_out_fmt(out, NULL, args); } } while (0)
|
||||||
|
|
||||||
void apk_out_reset(struct apk_out *);
|
void apk_out_reset(struct apk_out *);
|
||||||
void apk_out_fmt(struct apk_out *, const char *prefix, const char *format, ...);
|
void apk_out_fmt(struct apk_out *, const char *prefix, const char *format, ...)
|
||||||
|
__attribute__ ((format (printf, 3, 4)));
|
||||||
void apk_out_log_argv(struct apk_out *, char **argv);
|
void apk_out_log_argv(struct apk_out *, char **argv);
|
||||||
|
|
||||||
struct apk_progress {
|
struct apk_progress {
|
||||||
|
@ -68,6 +69,7 @@ struct apk_indent {
|
||||||
|
|
||||||
int apk_print_indented(struct apk_indent *i, apk_blob_t blob);
|
int apk_print_indented(struct apk_indent *i, apk_blob_t blob);
|
||||||
void apk_print_indented_words(struct apk_indent *i, const char *text);
|
void apk_print_indented_words(struct apk_indent *i, const char *text);
|
||||||
void apk_print_indented_fmt(struct apk_indent *i, const char *fmt, ...);
|
void apk_print_indented_fmt(struct apk_indent *i, const char *fmt, ...)
|
||||||
|
__attribute__ ((format (printf, 2, 3)));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -132,7 +132,7 @@ static int add_main(void *ctx, struct apk_ctx *ac, struct apk_string_array *args
|
||||||
if (APK_BLOB_IS_NULL(b) || virtdep.conflict ||
|
if (APK_BLOB_IS_NULL(b) || virtdep.conflict ||
|
||||||
virtdep.result_mask != APK_DEPMASK_ANY ||
|
virtdep.result_mask != APK_DEPMASK_ANY ||
|
||||||
virtdep.version != &apk_atom_null) {
|
virtdep.version != &apk_atom_null) {
|
||||||
apk_err(out, "%s: bad package specifier");
|
apk_err(out, "%s: bad package specifier", actx->virtpkg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (virtdep.name->name[0] != '.' && non_repository_check(db))
|
if (virtdep.name->name[0] != '.' && non_repository_check(db))
|
||||||
|
|
|
@ -161,8 +161,7 @@ static int mkpkg_process_dirent(void *pctx, int dirfd, const char *entry)
|
||||||
return r;
|
return r;
|
||||||
default:
|
default:
|
||||||
apk_pathbuilder_push(&ctx->pb, entry);
|
apk_pathbuilder_push(&ctx->pb, entry);
|
||||||
apk_out(out, "%s: special file ignored",
|
apk_out(out, "%s: special file ignored", apk_pathbuilder_cstr(&ctx->pb));
|
||||||
apk_pathbuilder_cstr(&ctx->pb), entry);
|
|
||||||
apk_pathbuilder_pop(&ctx->pb);
|
apk_pathbuilder_pop(&ctx->pb);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -904,8 +904,8 @@ static int read_info_entry(void *ctx, const struct apk_file_info *ae,
|
||||||
read_info_line(ctx, l);
|
read_info_line(ctx, l);
|
||||||
} else if (strcmp(ae->name, ".INSTALL") == 0) {
|
} else if (strcmp(ae->name, ".INSTALL") == 0) {
|
||||||
apk_warn(&ri->db->ctx->out,
|
apk_warn(&ri->db->ctx->out,
|
||||||
"Package '%s-%s' contains deprecated .INSTALL",
|
"Package '%s-" BLOB_FMT "' contains deprecated .INSTALL",
|
||||||
pkg->name->name, pkg->version);
|
pkg->name->name, BLOB_PRINTF(*pkg->version));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue