タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

C++とc++とclangに関するrydotのブックマーク (3)

  • とても賢いコンパイラーの逆襲

    The Hacks of Life: The Dangers of Super Smart Compilers Clangの最適化が未定義の挙動を検出してコード片を消し去ってしまったことに引っかかった開発者の嘆き。 今日初めて、RenderFarmのDSF render(global scenaryを作成するのに使っている内部ツール)をClangで最適化コンパイルして実行した。 結果はsegfaultだった。これは驚きだ(そして自身消失だ)。というのも、最適化していないデバッグビルドは問題なく動くし、GCCでコンパイルされた最適化ビルドも正しく動く。-O0ではバグがない(つまり#if DEVコードのバグではない)ので、「最適化は何をやっているんだ」の時間だ。 大量のprintfと試行錯誤の結果、最適化は以下のようなコード片を丸ごとすっ飛ばしていることが判明した。 for(vector<me

  • clang-format を イイ感じに設定する - def yasuharu519(self):

    公開が遅れましたが 初心者 C++er Advent Calendar 2015 の 12日目の記事です。 C++ の良い点として、 clang-format のようなフォーマッタがある点だと思っています。 golang でも gofmt というフォーマッタがありますが、あんなかんじのやつです。 clang-format を使うことで、C/C++/Objective-C/Java/JavaScript/ProtocolBuffer などのコードフォーマッティングができます。 また、フォーマットの設定ををいろいろ変更でき、チームで設定を共有することで、 統一されたコードスタイルを実現することが可能です。 id:rhysd さんの vim-clang-format をvimに導入することで vimからも使えます。 github.com ClangFormatスタイルオプション - Algo13

    clang-format を イイ感じに設定する - def yasuharu519(self):
  • ClangFormat — Clang 21.0.0git documentation

    ClangFormat¶ ClangFormat describes a set of tools that are built on top of LibFormat. It can support your workflow in a variety of ways including a standalone tool and editor integrations. Standalone Tool¶ clang-format is located in clang/tools/clang-format and can be used to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code. $ clang-format --help OVERVIEW: A tool to format C/C++/Java

  • 1