>From eafefd3a92789cd50c07e6fce04c1da7ea108224 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 16 Nov 2021 00:05:11 +0100 Subject: [PATCH] Improve error parsing for GCC -fanalyzer output * compile.el (compilation-error-regexp-alist-alist): Adjust gnu rule * compile-tests.el (compile-tests--test-regexps-data): Add testcase --- lisp/progmodes/compile.el | 5 ++++- test/lisp/progmodes/compile-tests.el | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index ac26f5e934..ff0beacfc1 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -351,7 +351,10 @@ compilation-error-regexp-alist-alist ;; from Ruby, but it is unclear whether it is actually ;; used since the gcc-include rule above seems to cover ;; it. - (regexp "[ \t]+\\(?:in \\|from\\)"))) + (regexp "[ \t]+\\(?:in \\|from\\)") + ;; Skip indentation generated by tools like GCC's + ;; -fanalyzer. + (: (+ space) "|"))) ;; File name group. (group-n 1 diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el index 2a3bb3dafa..c714b9ecfe 100644 --- a/test/lisp/progmodes/compile-tests.el +++ b/test/lisp/progmodes/compile-tests.el @@ -230,6 +230,7 @@ compile-tests--test-regexps-data (gnu "foo.c:8:23:information: message" 1 23 8 "foo.c") (gnu "foo.c:8.23-45: Informational: message" 1 (23 . 45) (8 . nil) "foo.c") (gnu "foo.c:8-23: message" 1 nil (8 . 23) "foo.c") + (gnu " |foo.c:8: message" 1 nil 8 "foo.c") ;; The next one is not in the GNU standards AFAICS. ;; Here we seem to interpret it as LINE1-LINE2.COL2. (gnu "foo.c:8-45.3: message" 1 (nil . 3) (8 . 45) "foo.c") -- 2.30.2