·编译c时出现数组元素的类型不完全错误

本文来自http://www.blog.edu.cn/user2/33357/archives/2006/1240145.shtml

·编译c时出现数组元素的类型不完全错误     -|kevinfang 发表于 2006-4-17 16:20:00
 
文件代码如下:
......
extern struct _fstruct ps_fontinfo[];
......
struct _fstruct {
char *name; /* Postscript font name */
int xfontnum; /* template for locating X fonts */
};
......
用gcc4编译时出现数组元素的类型不完全错误,这是因为gcc4不允许类型在声明前使用。
因此调换次序就可以顺利通过。
......
struct _fstruct {
char *name; /* Postscript font name */
int xfontnum; /* template for locating X fonts */
};
......
extern struct _fstruct ps_fontinfo[];
......
 

你可能感兴趣的:(c,struct,gcc,fonts,postscript)