From 8cac2bf0419274ffe93a4c2704a305e6cd94ff39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 25 Mar 2019 14:38:25 +0000 Subject: [PATCH] Make bundled Flymake C backend work for C++, too * lisp/progmodes/flymake-cc.el (flymake-cc-use-special-make-target): Pass -x flag according to major-mode. --- lisp/progmodes/flymake-cc.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/flymake-cc.el b/lisp/progmodes/flymake-cc.el index 524521d7db2..1b449bd0793 100644 --- a/lisp/progmodes/flymake-cc.el +++ b/lisp/progmodes/flymake-cc.el @@ -78,7 +78,11 @@ SOURCE." (defun flymake-cc-use-special-make-target () "Command for checking a file via a CHK_SOURCES Make target." (unless (executable-find "make") (error "Make not found")) - '("make" "check-syntax" "CHK_SOURCES=-x c -")) + `("make" + "check-syntax" + ,(format "CHK_SOURCES=-x %s -c -" + (cond ((derived-mode-p 'c++-mode) "c++") + (t "c"))))) (defvar-local flymake-cc--proc nil "Internal variable for `flymake-gcc'") -- 2.39.5