yohhoyの日記

技術的メモをしていきたい日記

Cスタイルキャスト利用を警告

gcc(g++)において、古いCスタイルキャストが使われた場合に警告するオプション。

-Wold-style-cast (C++ and Objective-C++ only)
 Warn if an old-style (C-style) cast to a non-void type is used within a C++ program. The new-style casts ('dynamic_cast', 'static_cast', 'reinterpret_cast', and 'const_cast') are less vulnerable to unintended effects and much easier to search for.

Using the GNU Compiler Collection (GCC) - 3.5 C++ Dialect Options

関連URL