You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
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
The Clang frontend supports several source-level annotations in the form of GCC-style attributes and pragmas that can help make using the Clang Static Analyzer more useful. These annotations can both help suppress false positives as well as enhance the analyzer's ability to find bugs. This page gives a practical overview of such annotations. For more technical specifics regarding Clang-specific an
Show Your Support: Did you know that the hundreds of articles written on Phoronix each month are mostly authored by one individual? Phoronix.com doesn't have a whole news room with unlimited resources and relies upon people reading our content without blocking ads and alternatively by people subscribing to Phoronix Premium for our ad-free service with other extra features. Linux 3.15 Can Almost Be
最近Objective-C書いてるのでClang-Formatというツールを試してみた。 些末なコードレビュー - naoyaのはてなダイアリー にもある通り、コードレビューするときにいちいちソースコードのフォーマットを指摘し続けるのはアンチパターンで、人間以外がやるべき仕事。 PerlならPerltidyというツールがあるけど、Objetive-C(C, C++)にはclang-formatというコマンドがある。暇なので社内で導入出来るように調べた。 ClangFormat — Clang 3.5 documentation 使い方 CLIの場合は以下のように実行する。-iで指定したファイルを上書き、-styleでフォーマットを指定する。 $ clang-format -i -style=Google Hoge.m これだけで既存のコードがフォマッターの設定通りに整えられる。 2014年
Emacsで、C/C++/Objective-C とかを書く時、clangを使った補完 clang-complete-async を使っている。 いままではiOS用の設定決めうちで使っていたのだが、 たまにMacアプリを書くときにcflags切り替えがめんどくさい 外部ライブラリを使っているプロジェクトで、そのライブラリのヘッダがよまれない と言った不満があった。 ちょっと最近またMacアプリを書いていてよしなにやってくれるやつが欲しいな〜という熱がたかまったので作ってみた。 typester/clang-complete-helper 何をするやつ? 編集しているファイルから、xcodeプロジェクトを探して、その設定を読んでよしなにCFLAGSをセットしてくれるやつ。 なのでこれを使えば、xcodeのプロジェクトのファイルであればなにも考えなくてもclangによる補完が効くようになる。
The Clang Static Analyzer is a source code analysis tool that finds bugs in C, C++, and Objective-C programs. Currently it can be run either from the command line or if you use macOS then within Xcode. When invoked from the command line, it is intended to be run in tandem with a build of a codebase. The analyzer is 100% open source and is part of the Clang project. Like the rest of Clang, the anal
LLVM 3.4 がリリースされました。 Download LLVM 3.4 LLVM 3.4 Release Notes Clang 3.4 Release Notes Clang Language Extensions — Clang 3.4 documentation Clang Compiler User’s Manual — Clang 3.4 documentation LLVM 3.4 リリースノートの訳 - Boost Your Programming! C++14, C++11 and C++98 Support in Clang 予定では去年末にリリースされる予定だったのですが、少し遅れて年明けにリリースされました。 ご存知の通り LLVM/Clang 3.4 では現行の C++14 の言語仕様が全て実装されています。 また、今回のリリースでは Windows 向けのバ
先日llvm 3.3がリリースされました。aarch64(arm 64bit)のコードが生成できるようになったということなので、ソースからビルドして遊んでいたのですが、さりげなく凄く最適化されたコードが生成されているのに気がつきました。aarch64だと今は実行して確認できる環境が手元に無いので、普通のarmv7-aで同じことを試しました。 ここで使ったコードとその結果はgistに貼りました。 https://gist.github.com/tetsu-koba/5835724 ソースコード int sum(int x) { int sum = 0; int i; for (i = 1; i <= x; i++) { sum += i; } return sum; } 1からnまでの総和を求める関数です。1から100までの総和が5050なのはガウス少年の逸話で有名ですね。 gcc 4.8.
[Phoronix] LLVM's Clang Compiler Is Now C++11 Feature Complete C++11 support is now feature-complete. · e6e68b5 · llvm-mirror/clang · GitHub 3時間前のコミットにより、Clangは晴れてC++11規格を完全に実装した。その通り、完全にすべて実装した。 コミットは、Inheriting Constructorsとthread_localの機能を有効にする変更だ。 もちろん、まだ実装にバグは残っているだろうし、規格上のバグもあるので、開発に終わりはない。ただし、今日は記念すべき日である。 static_puts said... そうすると、ますますC++11本の重要性が高まってきますね! 「寄付のお願い」の方にも書かせていただいたのですが、書籍の執筆への寄
The Clang community is continually striving to improve C++ standards compliance between releases by submitting and tracking C++ Defect Reports and implementing resolutions as they become available. Experimental work is also under way to implement C++ Technical Specifications that will help drive the future of the C++ programming language. The LLVM bug tracker uses the "c++" label, as well as mode-
Clang, LLVM's compiler front-end for C-based languages, features a couple of interesting language extensions to C, C++ and Objective-C. You are probably familiar with auto-synthesis of properties or the new subscripting syntax. One of the lesser known extensions, however, is the __attribute__((overloadable)) annotation. While languages like Java and C++ allow you to define multiple functions with
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く