]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Pacify GCC 16.1 -Wanalyzer-use-of-uninitialized-value master
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 May 2026 22:37:37 +0000 (15:37 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 May 2026 22:38:15 +0000 (15:38 -0700)
This fixes a false positive with gcc 16.1.1 20260501 (Red Hat
16.1.1-1) on x86-64.
* src/extract.c (set_stat): Use differently-worded but equivalent test
to help the compiler see that ts[0].tv_sec is used only if sedt.

src/extract.c

index dab1f3289209fc989051b3c9cb3e8c7eaefd351a..5cc3ccd6e8567df5b17ea4709d8b1eb815ca836e 100644 (file)
@@ -455,7 +455,7 @@ set_stat (char const *file_name,
        }
       if (r == 0)
        {
-         if (incremental_option)
+         if (ts[0].tv_nsec != UTIME_OMIT)
            check_time (file_name, ts[0]);
          check_time (file_name, ts[1]);
        }