5

I use Flycheck to check C files, and have a fairly elaborate variable setup for GCC to allow it to work correctly. However, due to having Clang on my system (for reasons unrelated to code), Flycheck always assumes that this is what I want to use, forcing me to manually switch checkers all the time.

I've tried to look for a way to permanently disable Clang as a checker, but I've come up empty. Help would be appreciated.

Koz Ross
  • 3,040
  • 2
  • 24
  • 44

1 Answers1

9

You should be able to add c/c++-clang to the variable flycheck-disabled-checkers. From the documentation of this variable (C-h v flycheck-disabled-checkers):

A list of Flycheck syntax checkers to exclude from automatic selection. Flycheck will never automatically select a syntax checker in this list, regardless of the value of `flycheck-checkers'.

Simply add (add-to-list 'flycheck-disabled-checkers 'c/c++-clang) to your init file.

pmr
  • 58,701
  • 10
  • 113
  • 156
  • 1
    That doesn't seem to have fixed it - it still defaults to Clang on a new .c file. – Koz Ross Feb 14 '15 at 23:07
  • 1
    This variable is buffer local by default. You need to use `setq-default` to change the global value. –  Feb 15 '15 at 08:48
  • @lunaryorn: So what would I need to put into my init file? I'm a bit new to Emacs Lisp still. – Koz Ross Feb 15 '15 at 09:26
  • 2
    @KozRoss Sorry for that. Either you add `(setq-default flycheck-disabled-checkers '(c/c++-clang))` to your init file OR you use customize: `M-x customize-group RET flycheck RET` and customize the disabled checkers group. – pmr Feb 15 '15 at 10:14