]> git.cworth.org Git - notmuch/commitdiff
configure: avoid warning with -Wall
authorMichael J Gruber <git@grubix.eu>
Mon, 18 Apr 2022 14:48:50 +0000 (16:48 +0200)
committerDavid Bremner <david@tethera.net>
Tue, 19 Apr 2022 20:11:46 +0000 (17:11 -0300)
7228fe68 ("configure: restructure gmime cert validity checker code",
2022-04-09) restructured generated C code to repurpose it later on. This
put usage of `validity` within an `#if`, resulting in an "unused
warning" if that `#if` is not executed.

Put the variable declariation inside the same if branch and, thus,  quel
the warning.

Signed-off-by: Michael J Gruber <git@grubix.eu>
configure

index 2f6d8b687b46eea3d84f7ec4af8291a5f8b76ed3..30fee6ab06e0983297d3efaad80739f99549c91a 100755 (executable)
--- a/configure
+++ b/configure
@@ -564,7 +564,6 @@ int main () {
     GMimeSignature *sig = NULL;
     GMimeCertificate *cert = NULL;
     GMimeObject *output = NULL;
-    GMimeValidity validity = GMIME_VALIDITY_UNKNOWN;
     int len;
 
     g_mime_init ();
@@ -586,7 +585,7 @@ int main () {
     cert = g_mime_signature_get_certificate (sig);
     if (cert == NULL) return !! fprintf (stderr, "no GMimeCertificate found\n");
 #ifdef CHECK_VALIDITY
-    validity = g_mime_certificate_get_id_validity (cert);
+    GMimeValidity validity = g_mime_certificate_get_id_validity (cert);
     if (validity != GMIME_VALIDITY_FULL) return !! fprintf (stderr, "Got validity %d, expected %d\n", validity, GMIME_VALIDITY_FULL);
 #endif
 #ifdef CHECK_EMAIL