From 125321c4a3ee3bf75c88e9ccb75ed328d2816c42 Mon Sep 17 00:00:00 2001 From: George Hansper Date: Sat, 30 Sep 2023 19:51:28 +1000 Subject: [PATCH] Fix some compiler warnings in lens.c, augmatch.c --- src/augmatch.c | 2 +- src/lens.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/augmatch.c b/src/augmatch.c index 67c9d2a6c..ba142c0cf 100644 --- a/src/augmatch.c +++ b/src/augmatch.c @@ -302,7 +302,7 @@ static char *guess_lens_name(const char *file) { int main(int argc, char **argv) { int opt; - cleanup(aug_closep) struct augeas *aug; + cleanup(aug_closep) struct augeas *aug = NULL; cleanup(freep) char *loadpath = NULL; size_t loadpath_len = 0; cleanup(freep) char *root = NULL; diff --git a/src/lens.h b/src/lens.h index d1a37cdad..1934778b1 100644 --- a/src/lens.h +++ b/src/lens.h @@ -274,6 +274,8 @@ char *enc_format_indent(const char *e, size_t len, int indent); #if ENABLE_DEBUG void dump_lens_tree(struct lens *lens); void dump_lens(FILE *out, struct lens *lens); +#else +#define dump_lens_tree(lens) (void)0 #endif #endif