From 67c3a3af1d9e2582193d5ea33b6c190e79ad56e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 25 Mar 2019 14:50:20 +0000 Subject: [PATCH] Avoid occasional confusion of Flymake C/C++ backend The regexp would sometimes match non-errors and create a diagnostic with nil severity, which would have consequences for the Flymake engine (these should eventually be addressed, too). * lisp/progmodes/flymake-cc.el (flymake-cc--make-diagnostics): Tighten regexp. --- lisp/progmodes/flymake-cc.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/flymake-cc.el b/lisp/progmodes/flymake-cc.el index 1b449bd0793..248c95a256f 100644 --- a/lisp/progmodes/flymake-cc.el +++ b/lisp/progmodes/flymake-cc.el @@ -58,7 +58,9 @@ SOURCE." (cl-loop while (search-forward-regexp - "^\\(In file included from \\)?:\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?:\n?\\(.*\\): \\(.*\\)$" + (concat + "^\\(In file included from \\)?:\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)" + "?:[\n ]?\\(error\\|warning\\|note\\): \\(.*\\)$") nil t) for msg = (match-string 5) for (beg . end) = (flymake-diag-region -- 2.39.5