diff --git a/configure.ac b/configure.ac index 73adb80..b532d43 100644 --- a/configure.ac +++ b/configure.ac @@ -96,10 +96,6 @@ if test "$gl_gcc_warnings" = yes; then nw="$nw -Wsuggest-attribute=pure" nw="$nw -Wduplicated-branches" # Too many false alarms - # Avoid false alarm in lib/vasnprintf.c. - # https://lists.gnu.org/r/bug-gnulib/2021-01/msg00031.html - gl_WARN_ADD([-Wno-analyzer-null-argument]) - gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw]) AC_SUBST([GNULIB_WARN_CFLAGS]) fi diff --git a/src/diff.h b/src/diff.h index 27362c0..0849a55 100644 --- a/src/diff.h +++ b/src/diff.h @@ -355,7 +355,9 @@ extern void print_context_script (struct change *, bool); extern int diff_dirs (struct comparison const *, int (*) (struct comparison const *, char const *, char const *)); -extern char *find_dir_file_pathname (char const *, char const *); +extern char *find_dir_file_pathname (char const *, char const *) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE + _GL_ATTRIBUTE_RETURNS_NONNULL; /* ed.c */ extern void print_ed_script (struct change *); diff --git a/src/diff3.c b/src/diff3.c index 6be7e3c..1f656b6 100644 --- a/src/diff3.c +++ b/src/diff3.c @@ -16,6 +16,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +/* As of GCC 11.2.1, gcc -Wanalyzer-too-complex reports that this + program's code is too complicated for gcc -fanalyzer. + FIXME: Compile with -DANALYZER_NULL_DEFERENCE and see whether the + resulting diagnostics are false alarms. */ +#if 10 <= __GNUC__ && !ANALYZER_NULL_DEREFERENCE +# pragma GCC diagnostic ignored "-Wanalyzer-null-dereference" +#endif + #include "system.h" #include "paths.h"