タグ

C11に関するAmaiSaetaのブックマーク (3)

  • C11 - Generic Selections

    C99 introduced type-generic macros defined in the new tgmath.h header. These are macros that expand to the appropriate function based on the type of the provided argument. For example, their are 6 different arc cosine functions: 3 for the different real floating point types and 3 for the different complex floating point types. If you #include <tgmath.h>, a macro with the name acos is exposed which

  • パスワードとmemset関数 - yohhoyの日記

    C言語プログラム上で高機密性情報(パスワード文字列など)を消去するケースで、memset関数の単純利用では機密情報がメモリ上に残存してしまい、セキュリティ上の脆弱性につながる可能性がある。 void secure_operation() { // パスワード文字列を取得 char passwd[128]; get_password(passwd, sizeof(passwd)); //... // メモリ上の高機密データを消去... memset(passwd, 0, sizeof(passwd)); // ?? } 上記コードではパスワード文字列が格納された変数passwdを使用後にゼロクリアしているが、コンパイル時の最適化によりmemset関数呼び出しが削除される可能性がある。この(プログラマの意図に反する)最適化は、C言語の言語仕様上も許容されるコンパイラの振る舞いとなっている。*1

    パスワードとmemset関数 - yohhoyの日記
  • C言語だって成長する! 標準がC11(C1X)にアップデート CodingFirst

    C言語、PerlJavaScript、最近はPythonも。出来上がったものより、プログラムを書くことが好き。あと、スイーツ。 C言語の標準がC11(C1X)にアップデートされた。 Unicode、ジェネリックマクロ、マルチスレッド、無名構造体/共用体などなど。 もともとC11については下の記事で知った。 ISO Updates C Standard - Slashdot 早速、規格を見てみようと思ったのだけど、 正式なものはちょっとお高いので、元にしたドラフト版を確認する事にした。 www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf ...と、見てみたら600頁以上あってしんどいので挫折。 代わりに wikipediaにアップデート内容の記事を見てみた。 C1X - Wikipedia, the free encyclopedia Al

    AmaiSaeta
    AmaiSaeta 2012/06/29
    "Removal of the gets function"ってマジか…… | "Bounds-cheching interfaces"はVC++2005以降の独自拡張だったSecureCRT相当か?
  • 1