From: Philip Kaludercic Date: Mon, 15 Nov 2021 23:05:11 +0000 (+0100) Subject: Improve error parsing for GCC -fanalyzer output X-Git-Tag: emacs-29.0.90~2852^2~128 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=08ccce2257d81ae4e8a579c374f6a8e886992385;p=emacs.git 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 --- diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 14da5880203..c0e16ce3515 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -351,7 +351,10 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) ;; 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 2a3bb3dafae..c714b9ecfe5 100644 --- a/test/lisp/progmodes/compile-tests.el +++ b/test/lisp/progmodes/compile-tests.el @@ -230,6 +230,7 @@ (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")