I am using flycheck with its defaults to write modern C++ code. I frequently get warnings such as:

extended initializer lists only available with -std=c++11 or -std=gnu++11

when using modern features.

Can somebody tell me the best way to disable the warnings related to c++11 or c++14?

  • See the author's own answer here. Commented Apr 12, 2017 at 23:55
  • Ah, I didn't see that post. Thank you
    – Startec
    Commented Apr 13, 2017 at 0:24

1 Answer 1


From @lunaryorn:

Flycheck provides the option flycheck-gcc-language-standard for this purpose. You should not set it globally, because that will break checking of C files, but you can set it from c++-mode-hook with the following code in your init file:

(add-hook 'c++-mode-hook (lambda () (setq flycheck-gcc-language-standard "c++11")))

However, I would recommend against this. Instead, use Directory Variables to configure the language standard per project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.