-
-
Save phikal/2e7dc35423be1ebf891637c9329203a9 to your computer and use it in GitHub Desktop.
My flymake settings for C/C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; just an example | |
((c++-mode . ((flymake-additional-clang-flags . ("-I../" "-std=c++0x"))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'flymake) | |
(defvar flymake-additional-clang-flags nil) | |
(put 'flymake-additional-clang-flags 'safe-local-variable 'listp) | |
;; no need to arrange Makefile | |
(defun flymake-cc-init () | |
`("clang" | |
("-fsyntax-only" "-Weverything" | |
,@flymake-additional-clang-flags | |
,(file-name-nondirectory | |
(flymake-proc-init-create-temp-buffer-copy | |
'flymake-create-temp-inplace))))) | |
;; (push (list (rx "." (or "c" "h" "cc" "cpp" "hh") eos) | |
;; #'flymake-cc-init) | |
;; flymake-proc-allowed-file-name-masks) | |
;; (add-hook 'c-mode-hook #'flymake-mode) | |
;; (add-hook 'c++-mode-hook #'flymake-mode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With a recent enough version of Flymake, all you have to do is to set
flymake-cc-command
like