タグ

Cに関するpaellaのブックマーク (41)

  • あらゆるCプログラマが未定義の動作について知るべきこと - YAMDAS現更新履歴

    LLVM Project Blog: What Every C Programmer Should Know About Undefined Behavior #1/3 LLVM Project Blog: What Every C Programmer Should Know About Undefined Behavior #2/3 LLVM Project Blog: What Every C Programmer Should Know About Undefined Behavior #3/3 コンパイラ基盤 LLVM のブログで、未定義の動作という C 言語のダークサイドについての記事が3回シリーズで公開されている。 C 言語で未定義の動作を実行したら、「鼻から悪魔が飛び出しても文句が言えない」というジョークは有名で……いや、そんなのを知ってるのは年寄りくらいか(参考:nasa

    あらゆるCプログラマが未定義の動作について知るべきこと - YAMDAS現更新履歴
    paella
    paella 2011/05/23
    あとで読む。LLVMプロジェクトのブログで書かれた記事3回分を引用している。
  • High and Low-Level C

    Jim Larson 1996-09-13 This talk was given at the Section 312 Programming Lunchtime Seminar. Introduction Tower of languages. High-level languages can (mostly) compile to lower-level ones. Might want to write in low-level language for access to hardware level. Can write high-level code in low-level language by compiling in your head. Might want to write in high-level language for flexibility and po

    paella
    paella 2011/02/21
    ローレベル、ハイレベルでCを使うときのテクニック。パケットヘッダの表現などもあるよ。
  • Category/Library/C - Free Software Directory

    ADG The ADG library (Automatic Drawing Generation) is a set of functions focused on automating the drawing of mechanical parts. It is not a CAD system but a library providing a non-interactive canvas where you can put common CAD entities such as paths, xatches and quotes, to create your technical drawings. The final result can be displayed inside a GTK+ widget or exported to any cairo available fo

    paella
    paella 2011/02/21
     CGLib,neonChipmunkcoroutine(CheapThreads)  

    C

    library




     
  • C言語の代表的なウェブリソース10選 - YAMDAS現更新履歴

    Top 10 C Language resources that will turn you into a better programmer - C and C++ Programming Resources 今更 C 言語かと言われそうだが、Linux カーネルだって、我々が利用している LL 言語の多くだってこの言語で書かれているのである。ワタシ自身は未だどの言語よりCを愛している。 以下に C 言語に関してウェブに公開されている代表的なリソースを挙げていく。さすがに更新が長らく止まっているものが多いが、それでも有用な情報源には違いない。ネタ元は Hacker News。 C Programming Notes Programming in C - UNIX System Calls and Subroutines using C. C Lesson by Chris Sawtell

    C言語の代表的なウェブリソース10選 - YAMDAS現更新履歴
    paella
    paella 2011/02/21
    6のCで書かれたコレクションの中にはChipmunkの紹介もあったりと、これは良いまとめ。
  • 続・GCC拡張を使ったusing | 株式会社きじねこ

    以前、「GCC拡張を使ったusing」という記事を書きました。あれから2ヶ月半ほど経ちましたが、今になって思うと、肝心なGCC拡張を忘れていたことに気付きます。"cleanup"がそれです。 "cleanup"は__attribute__で関数を指定するGCC拡張です。"cleanup"を指定した自動変数は、その生存期間が終わる時点で、指定した関数が呼び出されます。つまり、デストラクタと同じことができるわけです。 話を簡単にするために、後始末としてはfreeでメモリを解放する場合に限定して考えることにします。 #include <stdio.h> #include <stdlib.h> #include <string.h> void cleanup(void *p) { free(*(void**)p); puts(__func__); } #define using(decl) \ f

    paella
    paella 2011/01/14
    「__attribute__((cleanup(関数ポインタ))) 変数宣言」として書くと、変数のスコープから抜けたときに自動的に関数ポインタで示す関数を呼んでくれる。簡易的なデストラクタ。
  • StateパターンでCSVを読む

    こんなのを読み込んで適当な処理を施して欲しい、と。Excelのシートから各セルの値を拾い出すのはさほどに難しくはないのですが、いかんせん時間がなかったのでいったんはお断りしたところ、「Excelシートを直接読むのが面倒ならCSVからでもかまわん」とのこと。CSVならフツーにテキストファイルを読めばいいから小一時間で作れそう、昼メシ奢ってもらうのを報酬に引き受けることにしました。 CSVのフォーマット CSV(Comma Separated Values)はMS-DOSあるいはその以前からスプレッドシートのデータ・フォーマットとして使われています。CSVの規格/標準としてはRFC4180がありますが、こいつは2005年に作られたものでそれ以前のアプリケーションがRFC4180に準拠していることは期待できるはずもありません。とはいえ、まずはRFC4180に従って作られたCSVなら正しく読めるこ

    StateパターンでCSVを読む
    paella
    paella 2010/12/14
    デザインパターンの勉強によいかも。勉強に。
  • https://www.hi-matic.org/diary/?20100601

    paella
    paella 2010/06/04
    UNIX環境での多言語対応について。gettextの使い方なわけだけれど、/usr/local/shareみたいな場所に国際化の文字列を入れるんだね。アンインストールでゴミが残りそうでやな感じ。
  • CプリプロセッサでBrainfuck

    Cプリプロセッサ上で実装されたBrainfuckインタプリタです。 $ cat hello.txt # include "bfi.h" BFI_RUN1(x x x x x x x x x (b x x x x x x x x b x x x x x x x x x x x b x x x x x d d d _) b w b x x w x x x x x x x w w x x x w b _ w _ _ _ _ _ _ _ _ _ _ _ _ w d x x x x x x x x w _ _ _ _ _ _ _ _ w x x x w _ _ _ _ _ _ w _ _ _ _ _ _ _ _ w b x w) $ cpp -P hello.txt Hello, world! bfi-0.tar.gz 使い方 "bfi.h"で定義されているBFI_RUNマクロがインタプリタの体で

    paella
    paella 2010/03/01
    CプリプロセッサでBrainfuckインタプリタを実現しているという変態的プログラム。これはすごい。
  • dfltweb1.onamae.com – このドメインはお名前.comで取得されています。


     .com  .com  GMO() No.1  調 1ICANN()gTLD ()ICANNInterNICJapan GMO Internet Group, Inc. d/b/a Onamae.com 20235調
    paella
    paella 2010/02/21
    けれど高い…
  • Google Code Archive - Long-term storage for Google Code Project Hosting.

    paella
    paella 2010/01/21
     Simple Gtk+ 2 Guitar TunerGPLv2  

    c

    tuning


     
  • Reddit - Dive into anything

    paella
    paella 2010/01/19
    組み込みプログラマ向けのCの理解度テスト。さあ、どれくらいの結果になるだろう。
  • WG 14 N1420: On The Removal of gets()

    Background The gets function in the stdio.h section of the C standard has long been a source of programming errors and vulnerabilities. Many compilers issue a warning when it is used. In TC3, WG14 marked this function as obsolete. This paper is intended to give editorial direction to the project editor to completely remove this function from the next revision of the standard. Compiler and library

    paella
    paella 2009/12/28
    gets()がついに無くなるんだ。へー。
  • 最新Cコンパイラーの最適化事情 - Radium Software


    State of the art C compiler optimization tricks, Felix von Leitner, Linux Kongress 2009.  SIMD調   gcc  gcc  
    最新Cコンパイラーの最適化事情 - Radium Software
    paella
    paella 2009/12/28
    考える元。結構賢いことをやっているよ、という記事の紹介。本文は後で読もう.
  • 私は C 言語が好きだ

    @omimaro0115 ++ が好きだ ?: が好きだ マクロが好きだ 共用体が好きだ ビットフィールドが好きだ void* が好きだ ポインタ演算が好きだ ポインタのキャストが好きだ 2009-12-25 14:12:09 @omimaro0115 UNIX で WindowsMacintosh で PalmOS で iTRON で メインフレームで ワークステーションで PC で PDA で 組み込みで この地上で行われる、ありとあらゆる C プログラミングが大好きだ 2009-12-25 14:12:17

    私は C 言語が好きだ
    paella
    paella 2009/12/25
    面白いね。「諸君 私は C 言語が大好きだ」
  • Using c library in objective c

    paella
    paella 2009/12/21
    なるほど、Cの仕様に無名のstructやunionはなくて、それはコンパイラ拡張だったんだ。知らなかった。
  • BohYoh.com-C/C++ FAQ 文字定数の型は何ですか。

    paella
    paella 2009/12/10
     'a'CC++Cinteger character constantintC++character literalchar  

    c

    c++
     
  • Cプリプロセッサメタプログラミングで、文字列系泥沼関数型プログラミング - 簡潔なQ


     - CC C PerlC++ C 使C C (GCC調C
    Cプリプロセッサメタプログラミングで、文字列系泥沼関数型プログラミング - 簡潔なQ
    paella
    paella 2009/11/09
    プリプロセッサだけでフィボナッチ数列を求めている素敵なマクロ。これはすごい。このマクロならズルではないはず!
  • C function always returns zero to Objective C

    paella
    paella 2009/11/04
    Cで陥りがちな穴にはまっている。今度、後輩に出題してみようかな。
  • Account Suspended

    Account Suspended This Account Has Been Suspended

    paella
    paella 2009/10/27
      http://is.gd/4E35W  http://is.gd/4E37A   

    c

    tips


     
  • C/C++ 迷信集 | 株式会社きじねこ


    C/C++ 使 OJT     C/C++  (2009/03/15) C/C++ [] 
    paella
    paella 2009/10/17
     C/C++ C++  

    c

    c++