サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
体力トレーニング
kristerw.blogspot.com
My twitter feed has recently been filled with discussions about the following program #include <cstdlib> typedef int (*Function)(); static Function Do; static int EraseAll() { return system("rm -rf /"); } void NeverCalled() { Do = EraseAll; } int main() { return Do(); } that clang compiles to main: movl $.L.str, %edi jmp system .L.str: .asciz "rm -rf /" That is, the compiled program executes “rm -
Note: This blog post was written for GCC 7. Later versions of the compiler may have added some of these warnings to -Wall or -Wextra. GCC can warn about questionable constructs in the source code, but most such warnings are not enabled by default – developers need to use the options -Wall and -Wextra to get all generally useful warnings. There are many additional warning options that are not enabl
Random thoughts on programming languages, compilers, operating systems, etc. Compilers can do a better job optimizing a function if they can use knowledge of other functions. The obvious case is inlining, but there are many more cases. This post lists the interprocedural optimizations implemented in GCC 7. Many of the optimizations are only relevant for large functions (small functions are inlined
このページを最初にブックマークしてみませんか?
『kristerw.blogspot.com』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く