hns - 日記自動生成システム - Version 2.19.9

先月 2007年07月 来月
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2007年07月14日() 旧暦 [n年日記] [更新:"2007/07/20 20:38:57"]

#1 [NetBSD] dereferencing pointer to incomplete type

In file included from src/sys/lkm/vfs/hfs/lkminit_vfs.c:53:
src/sys/fs/hfs/hfs.h: In function 'GET8B':
src/sys/fs/hfs/hfs.h:133: error: dereferencing pointer to incomplete type
src/sys/fs/hfs/hfs.h: In function 'GET16B':
src/sys/fs/hfs/hfs.h:142: error: dereferencing pointer to incomplete type
src/sys/fs/hfs/hfs.h: In function 'GET32B':
src/sys/fs/hfs/hfs.h:151: error: dereferencing pointer to incomplete type
こんな簡単そうな問題が解けないなんてさびしいので、じっくりと:
src/sys/fs/hfs/hfs.h: (これは名前が同じでも中身が全然違う)。以下の中身は、つばい版
 38 #include <miscfs/genfs/genfs_node.h>

 96 static u_int GET8B(struct buf *, int);
 97 static u_int GET16B(struct buf *, int);
 98 static u_int GET32B(struct buf *, int);

128 static inline u_int
129 GET8B(bp, off)
130         struct buf *bp;
131         int off;
132 {
133         u_int8_t *p = (char *)bp->b_data + off;
134         return *p; 
135 } 
136  
137 static inline u_int
138 GET16B(bp, off)
139         struct buf *bp;
140         int off;
141 {
142         u_int16_t *p = (void *)((char *)bp->b_data + off);
143         return *p;
144 }
145  
146 static inline u_int
147 GET32B(bp, off)
148         struct buf *bp;
149         int off;
150 {
151         u_int32_t *p = (void *)((char *)bp->b_data + off);
152         return *p;
153 }
sys/sys/buf.h:
119 struct buf {
120         union {
121                 TAILQ_ENTRY(buf) u_actq; /* Device driver queue when active. */
122 #if defined(_KERNEL) /* u_work is smaller than u_actq. XXX */
123                 struct work u_work;
124 #endif /* defined(_KERNEL) */
125         } b_u;
126 #define b_actq  b_u.u_actq
127 #define b_work  b_u.u_work
128         struct simplelock b_interlock;  /* Lock for b_flags changes */
129         volatile int b_flags;           /* B_* flags. */
130         int     b_error;                /* Errno value. */
131         int     b_prio;                 /* Hint for buffer queue discipline. */
132         int     b_bufsize;              /* Allocated buffer size. */
133         int     b_bcount;               /* Valid bytes in buffer. */
134         int     b_resid;                /* Remaining I/O. */
135         dev_t   b_dev;                  /* Device associated with buffer. */
136         struct {
137                 void *  b_addr;         /* Memory, superblocks, indirect etc. */
138         } b_un;
..
188 #define b_data   b_un.b_addr            /* b_un.b_addr is not changeable. */
dereferencing pointer to incomplete type の 日本語訳は 「ポインタ元へ参照の時に型が合っていない」
             +--------+
  ポインタ →|  実体  |
             +--------+
ポインタ参照 (pointer reference) とは、実体をポインタの値(アドレス)を使って参照したり 取扱ったりすること
ポインタ元へ参照とは、実体の値を得ること
(だと思う)
b_addr は void *
しかし最近は caddr_t になっている。逆か、以前は caddr_t で最近は void *。
上の問題は、実は 単に #include <sys/buf.h> が抜けていただけ のようだ。 こういう、何か不可解な場合、「単に定義されていないだけ」というのが良くある。

./build.sh sets:

という訳で、最後は ./build.sh sets だったけれど、久し振りに release が出来た。
===> Successful make sets
===> build.sh ended:   Sun Jul 15 02:08:24 JST 2007
===> Summary of results:
         build.sh command: ./build.sh -u 
	   -T /export/20070526ts/checkout/src/tooldir.NetBSD-4.99.9-powerpc sets
         build.sh started: Sun Jul 15 02:06:16 JST 2007
         NetBSD version:   4.99.20
         MACHINE:          macppc
         MACHINE_ARCH:     powerpc
         Build platform:   NetBSD 4.99.9 macppc
         HOST_SH:          /bin/sh
         TOOLDIR path:     /export/20070526ts/checkout/src/tooldir.NetBSD-4.99.9-powerpc
         DESTDIR path:     /export/20070526ts/checkout/src/obj/destdir.macppc
         RELEASEDIR path:  /export/20070526ts/checkout/src/obj/releasedir
         makewrapper:      
 /export/20070526ts/checkout/src/tooldir.NetBSD-4.99.9-powerpc/bin/nbmake-macppc
         Updated 
 /export/20070526ts/checkout/src/tooldir.NetBSD-4.99.9-powerpc/bin/nbmake-macppc
         Building sets from pre-populated /export/20070526ts/checkout/src/obj/destdir.macppc
         Successful make sets
         build.sh ended:   Sun Jul 15 02:08:24 JST 2007
===> .
(と思ったら kernel が出来ていない、どうも変だと思った) -u を不用意に使うと、こうなるらしい。

... ではなくて、flist で失敗した。flist を通すようにした。通ったので全て 終ったと思って sets を実行、というのが違っていて、「flist check が終っても」 まだ終了には程遠い、ということだったと思う。




最近の日記
2024年05月08日
comparison on ./buildsh tools
2024年05月06日
py-setuptools (python 3.11.9)
make release took 1 hours and 10 min
qemu invocation for 10.99.10
2024年05月05日
Windows 10 version
serial connection
bc bench
2024年05月04日
Trial on 10.99.10
another version (later trial) to succeed
2024年04月29日
dkim
以上、1 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project

Count.cgi (since 2000/02/05)