[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[debian-users:32696] Bug#JP/1545: Re: Bug#JP/1545: xpbiff can not build on alpha
At Fri, 3 May 2002 11:07:09 +0900,
Taketoshi Sano wrote:
> > xpbiff.c:349: (near initialization for `resources[4].resource_offset')
>
> これらに相当するのは
>
> static XtResource resources[] = {
> {"arrivePixmap", "ArrivePixmap", RPixmap2, sizeof(Pixmap2),
> (Cardinal)&arrivePixmap, XtRString, "None"},
> {"nomailPixmap", "NomailPixmap", RPixmap2, sizeof(Pixmap2),
> (Cardinal)&noPixmap, XtRString, "None"},
> {"nomailForeground", "NomailForeground", XtRPixel, sizeof(Pixel),
> (Cardinal)&colors[0], XtRString, "black"},
> {"nomailBackground", "NomailBackground", XtRPixel, sizeof(Pixel),
> (Cardinal)&colors[1], XtRString, "cyan"},
> {"arriveForeground", "ArriveForeground", XtRPixel, sizeof(Pixel),
> (Cardinal)&colors[2], XtRString, "yellow"},
> {"arriveBackground", "ArriveBackground", XtRPixel, sizeof(Pixel),
> (Cardinal)&colors[3], XtRString, "red"},
>
> なんですが、arrivePixmap は
>
> #ifdef XPM
> Pixmap arrivePixmaps[2], noPixmaps[2];
> #define arrivePixmap arrivePixmaps[0]
> #define noPixmap noPixmaps[0]
> #else
> Pixmap arrivePixmap, noPixmap;
> #endif
>
> としてファイルの冒頭 (mail() より前) で定義されて
> いるものなので、"not computable at load time" と
> 言われても、どういうことなのかよくわかりません。
次のサンプルプログラムを試してみてください。
これは、問題個所のプリミティブだけ取り出したものです。
#include <X11/Intrinsic.h>
typedef Pixmap Pixmap2[2];
Pixmap arrivePixmaps[2];
#define arrivePixmap arrivePixmaps[0]
typedef struct mope {
Cardinal hoge;
} fuga;
static fuga nyao[] = {
{
(Cardinal)&arrivePixmap
}
};
> gcc -c test.c
test.c:14: warning: initializer element is not computable at load time
test.c:14: initializer element is not constant
test.c:14: (near initialization for `nyao[0].hoge')
test.c:14: warning: initializer element is not computable at load time
test.c:14: initializer element is not constant
test.c:14: (near initialization for `nyao[0]')
test.c:15: initializer element is not constant
さてこれはどうでしょう。
#include <X11/Intrinsic.h>
typedef Pixmap Pixmap2[2];
Pixmap arrivePixmaps[2];
#define arrivePixmap arrivePixmaps[0]
typedef struct mope {
unsigned long hoge;
} fuga;
static fuga nyao[] = {
{
(unsigned long)&arrivePixmap
}
};
> gcc -c hoge.c
>
通りました。X11/Intrinsic.c には
typedef unsigned int Cardinal;
とあります。
つまり ILP32 - LP64 問題ぽい感じですね。だから、
> > xpbiff.c:351: initializer element is not computable at load time
> > xpbiff.c:351: (near initialization for `resources[5].resource_offset')
32 bit 幅に入らないことがありうるのでエラーになっているようです。
> 何故これが alpha 上でのみ問題になるのかも疑問です。
> (一応、satie.debian.org でも試してみて woody/i386 では
> 問題無く build できることは確認しました)
alpha は 64bit だからでしょう。
何か gcc のオプションや、include などで回避する方法があるかも
しれませんが、LP64 を考えていない元のソースを直すのが正解かと。
-- gotom