数组的元素类型不完整。 GCC错误? [英] Array has incomplete element type. GCC bug?

查看:90
本文介绍了数组的元素类型不完整。 GCC错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我目前正在努力编写大量遗留代码。 GCC

3.3编译它没有抱怨,但GCC 4.2.3(

Debian中的默认值)拒绝它并发出信号几个阵列有不完整的元素

类型错误。


我知道自4.0以来,GCC不太宽容,不接受

任何不完整类型的数组(见 http://gcc.gnu.org/ml/gcc/2005- 02 / msg00053.html)

但是,我无法在这里看到数组类型不完整的地方:


/ *来自标题* /

void grphcs_enhnc_outsquare(unsigned char [] [],const int,const int,

const int,const int y);


/ *来自:ERROR:数组类型的元素类型不完整* /

void grphcs_enhnc_outsquare(unsigned char outsquare [] [],const int w,

const int h,const int x,const int y)

{/ * ... * /}


/ *来自另一个标题* /

extern void bz_comp(int,int [],int [],int [],int *,int [] [],int

* []);


/ *来自相应的来源:ERROR:数组类型不完整

元素类型* /

void bz_comp(

int npoints,

int xcol [MAX_BOZORTH_MINUTIAE],

int ycol [MAX_BOZORTH_MINUTIAE],

int thetacol [MAX_BOZORTH_MINUTIAE],

int * ncomparisons,

int cols [] [COLS_SIZE_2],

int * colptrs []



{/ * ... * /}

任何人都可以流下一些亮点?


提前谢谢

- Arcadio

Hi everyone,

I''m currently struggling to compile a large piece of legacy code. GCC
3.3 compiles it without complaining, but GCC 4.2.3 (the default in
Debian) refuses it and signals "several array has incomplete element
type" errors.

I know that since 4.0 or so, GCC is less forgiving and does not accept
any arrays of incomplete type (see http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html).
However, I cannot see where the array types are incomplete here:

/* From the header */
void grphcs_enhnc_outsquare(unsigned char [][], const int, const int,
const int, const int y);

/* From the source: ERROR: Array type has incomplete element type */
void grphcs_enhnc_outsquare(unsigned char outsquare[][], const int w,
const int h, const int x, const int y)
{ /* ... */ }

/* From another header */
extern void bz_comp(int, int [], int [], int [], int *, int [][], int
*[]);

/* From the corresponding source: ERROR: Array type has incomplete
element type */
void bz_comp(
int npoints,
int xcol[ MAX_BOZORTH_MINUTIAE ],
int ycol[ MAX_BOZORTH_MINUTIAE ],
int thetacol[ MAX_BOZORTH_MINUTIAE ],

int * ncomparisons,
int cols[][ COLS_SIZE_2 ],
int * colptrs[]
)
{ /* ... */ }
Can anyone shed some light?

Thanks in advance
- Arcadio

推荐答案

In comp.lang.c,arcadio写道:
In comp.lang.c, arcadio wrote:

大家好,


我正在努力编译一个大的一段遗留代码。 GCC

3.3编译它没有抱怨,但GCC 4.2.3(

Debian中的默认值)拒绝它并发出信号几个阵列有不完整的元素

类型错误。
Hi everyone,

I''m currently struggling to compile a large piece of legacy code. GCC
3.3 compiles it without complaining, but GCC 4.2.3 (the default in
Debian) refuses it and signals "several array has incomplete element
type" errors.



[snip]

[snip]


/ *来自相应的来源:错误:数组类型不完整

元素类型* /

void bz_comp(

int npoints,

int xcol [MAX_BOZORTH_MINUTIAE],

int ycol [MAX_BOZORTH_MINUTIAE],

int thetacol [MAX_BOZORTH_MINUTIAE],

int * ncomparisons,

int cols [] [COLS_SIZE_2],
/* From the corresponding source: ERROR: Array type has incomplete
element type */
void bz_comp(
int npoints,
int xcol[ MAX_BOZORTH_MINUTIAE ],
int ycol[ MAX_BOZORTH_MINUTIAE ],
int thetacol[ MAX_BOZORTH_MINUTIAE ],

int * ncomparisons,
int cols[][ COLS_SIZE_2 ],



这个数组中有多少个cols元素?编译器如何确定这个数字是多少?b / b?br / >

How many cols elements are in this array? How can the compiler determine
that number?


int * colptrs []



{/ * ... * /}


有人能说光吗?


提前致谢


- Arcadio
int * colptrs[]
)
{ /* ... */ }
Can anyone shed some light?

Thanks in advance
- Arcadio



-

Lew Pitcher


Master Code Code& JOAT-in-training |已注册的Linux用户#112576
http://pitcher.digitalfreehold.ca/ |可根据要求提供GPG公钥

---------- Slackware - 因为我知道我在做什么。 ------

--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I''m doing. ------


arcadio说:


< snip>
arcadio said:

<snip>

但是,我看不到这里阵列类型不完整的




/ *来自标题* /

void grphcs_enhnc_outsquare(unsigned char [] []
However, I cannot see
where the array types are incomplete here:

/* From the header */
void grphcs_enhnc_outsquare(unsigned char [][]



^^^^

就在这里。


关于你的主题行,数组有不完整的元素类型.GCC错误?,

在第一个实例[1]中通常最明智的是假设错误是

你的代码除非你能从标准中证明你的代码

是正确的。


[1] ......和第二个例子,第三个......


-

Richard Heathfield< http://www.cpax.org.uk>

电子邮件:-http:// www。+ rjh @

Google用户:< http://www.cpax.org.uk/prg/writings/googly。 php>

Usenet是一个奇怪的地方 - dmr 1999年7月29日


arcadio写道:
arcadio wrote:

大家好,


我是目前正在努力编译大量的遗留代码。 GCC

3.3编译它没有抱怨,但GCC 4.2.3(

Debian中的默认值)拒绝它并发出信号几个阵列有不完整的元素

类型错误。


我知道自4.0以来,GCC不太宽容,不接受

任何不完整类型的数组(见 http://gcc.gnu.org/ml/gcc/2005- 02 / msg00053.html)

但是,我无法在这里看到数组类型不完整的地方:


/ *来自标题* /

void grphcs_enhnc_outsquare(unsigned char [] [],const int,const int,

const int,const int y);


/ *来自:ERROR:数组类型的元素类型不完整* /

void grphcs_enhnc_outsquare(unsigned char outsquare [] [],const int w,

const int h,const int x,const int y)

{/ * ... * /}


/ *来自另一个标题* /

extern void bz_comp(int,int [],int [],int [],int *,int [] [],int

* []);


/ *来自相应的来源:错误:数组类型有不完整

元素类型* /

void bz_comp(

int npoints,

int xcol [MAX_BOZORTH_MINUTIAE],

int ycol [MAX_BOZORTH_MINUTIAE],

int thetacol [MAX_BOZORTH_MINUTIAE],

int * ncomparisons,

int cols [] [COLS_SIZE_2],

int * colptrs []



{/ * ... * /}


任何人都可以解决问题吗?


先谢谢
Hi everyone,

I''m currently struggling to compile a large piece of legacy code. GCC
3.3 compiles it without complaining, but GCC 4.2.3 (the default in
Debian) refuses it and signals "several array has incomplete element
type" errors.

I know that since 4.0 or so, GCC is less forgiving and does not accept
any arrays of incomplete type (see http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html).
However, I cannot see where the array types are incomplete here:

/* From the header */
void grphcs_enhnc_outsquare(unsigned char [][], const int, const int,
const int, const int y);

/* From the source: ERROR: Array type has incomplete element type */
void grphcs_enhnc_outsquare(unsigned char outsquare[][], const int w,
const int h, const int x, const int y)
{ /* ... */ }

/* From another header */
extern void bz_comp(int, int [], int [], int [], int *, int [][], int
*[]);

/* From the corresponding source: ERROR: Array type has incomplete
element type */
void bz_comp(
int npoints,
int xcol[ MAX_BOZORTH_MINUTIAE ],
int ycol[ MAX_BOZORTH_MINUTIAE ],
int thetacol[ MAX_BOZORTH_MINUTIAE ],

int * ncomparisons,
int cols[][ COLS_SIZE_2 ],
int * colptrs[]
)
{ /* ... */ }
Can anyone shed some light?

Thanks in advance



extern void

bz_comp(int,int [],int [],int [],int *,

int [] [COLS_SIZE_2],int * []);


-

pete


extern void
bz_comp(int, int [], int [], int [], int *,
int [][COLS_SIZE_2], int *[]);

--
pete


这篇关于数组的元素类型不完整。 GCC错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆