mdbx: refine attribute-based macros.

This commit is contained in:
Leonid Yuriev
2019-08-25 03:05:58 +03:00
parent 7780b76cf0
commit 137d652d77
11 changed files with 101 additions and 83 deletions

View File

@@ -105,11 +105,7 @@ struct problem {
struct problem *problems_list;
uint64_t total_problems;
static void
#ifdef __GNUC__
__attribute__((format(printf, 1, 2)))
#endif
print(const char *msg, ...) {
static void __printf_args(1, 2) print(const char *msg, ...) {
if (!quiet) {
va_list args;
@@ -120,11 +116,7 @@ static void
}
}
static void
#ifdef __GNUC__
__attribute__((format(printf, 1, 2)))
#endif
error(const char *msg, ...) {
static void __printf_args(1, 2) error(const char *msg, ...) {
total_problems++;
if (!quiet) {
@@ -181,10 +173,8 @@ static walk_dbi_t *pagemap_lookup_dbi(const char *dbi_name, bool silent) {
return last = dbi;
}
static void
#ifdef __GNUC__
__attribute__((format(printf, 4, 5)))
#endif
static void __printf_args(4, 5)
problem_add(const char *object, uint64_t entry_number, const char *msg,
const char *extra, ...) {
total_problems++;