2004-07-12 (Mon)
_ [プログラミング] IA64 だと 0 と NULL は違う
ポインタを要求する文脈では常に 0 は NULL pointer を表わすってわけでもないのね.
[Memorandaより引用]
「ポインタを要求する文脈」かどうかがコンパイラには わからないケース(可変長引数)だったから、0でヌルポインタを生成してくれなかった、 ということじゃないのかなあ。
#define NULL 0
というのも規格的にはOKですよね、たしか。
あと、
#define NULL ((void *)0)
な処理系でも、void*とchar*の内部表現が違うと、キャストなしのNULL ではまずいんじゃないのかな(ってそんな処理系を実際に見たことはないのですけど)。
なので、ほんとは0をNULLにするんじゃなくて、(char *) 0とか適切な型に キャストしてやるべきな気が。 (まつもとさんがNULLを使わないのはポリシーなはず。)
とかいうのは全部私の勘違いかもしれませんので、間違ってたらごめんなさい。
[ツッコミを入れる]
[TrackBack URL: http://shugo.net/jit/tb.rb/20040712]
本日のリンク元
- http://www.dm4lab.to/~kjana/memo/ ×5
- http://search.live.com/results.aspx?q=mobile&mrt=e... ×4
- https://www.rubyist.net/~shugo/jit/ ×4
- http://www.myprofile.ne.jp/blog/archive/FFF/18 ×3
- http://search.live.com/results.aspx?q=mobile&form=... ×2
- http://sbs.mobile.yahoo.co.jp/union/search?p=null ×1
- http://64.233.179.104/translate_c?hl=en&u=http://s... ×1
- http://looseend.ddo.jp/blog/categorylist_html?cat_... ×1
- http://sbs.mobile.yahoo.co.jp/union/search?fr=m_to... ×1
- http://sbs.mobile.yahoo.co.jp/union/search?p=NULL ×1
- http://www.rubyist.net/~matz/200404.html ×1
- http://www.dm4lab.to/~kjana/memo/memo200407.html ×1
- http://gw.mobile.goo.ne.jp/gw/top/search_i.jsp;jse... ×1
- http://looseend.ddo.jp/blog/9 ×1
- ただのにっき(2004-03-16) ×1
- http://blog.chew.jp/result/en/en 規格 ×1
- http://mixi.jp/home.pl ×1
- http://www.rubyist.net/~matz/20040428.html ×1
- http://koba.s8.xrea.com/d/?category=Linux ×1
- https://www.rubyist.net/~shugo/jit/20040710.html ×1
- http://search.mobile.yahoo.co.jp/p/search/onesearc... ×1
- http://sbs.mobile.yahoo.co.jp/union/search?p=Null ×1
