LoginSignup
1
2

More than 5 years have passed since last update.

VSCode C++ 拡張で c++11以降のワーニングを表示させないようにする // Visual Studio Code c++11 extension warning

Last updated at Posted at 2019-03-16

VSCode C++ Extentionはデフォルトではc++11以降の記述はワーニングが出ます

例えば VSCode で C++ Extention を有効化した状態で

for (auto& v: vs) {}

などと書くと

:warning: range-based for loop is a C++11 extension [-Wc++11-extensions]
:warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]

などといったワーニングが出力されます。

こんな時は
settings.json

  "clang.cxxflags": ["-std=c++14"],

のようにc++11以降のコンパイル引数を追加することでワーニングが出なくなります。

参考

[stack overflow] Visual Studio Code c++11 extension warning

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2