我正在尝试构建一个旧的binutils(2.13)。收到错误./config/obj-elf.c:364:错误:下一行的'->'(具有'int')类型参数无效:
if (symbol_get_obj (symbolP)->local)
{...
函数symbol_get_obj:
OBJ_SYMFIELD_TYPE *
symbol_get_obj (s)
symbolS *s;
{
if (LOCAL_SYMBOL_CHECK (s))
s = local_symbol_convert ((struct local_symbol *) s);
return &s->sy_obj;
}
OBJ_SYMFIELD_TYPE定义为:
#define OBJ_SYMFIELD_TYPE struct elf_obj_sy
而elf_obj_sy是
struct elf_obj_sy
{
/* Whether the symbol has been marked as local. */
int local;
/* Use this to keep track of .size expressions that involve
differences that we can't compute yet. */
expressionS *size;
/* The name specified by the .symver directive. */
char *versioned_name;
#ifdef ECOFF_DEBUGGING
/* If we are generating ECOFF debugging information, we need some
additional fields for each symbol. */
struct efdr *ecoff_file;
struct localsym *ecoff_symbol;
valueT ecoff_extern_size;
#endif
};
无法理解此代码出了什么问题……有什么建议吗?
根据错误消息,一个可能的原因是该函数的声明symbol_get_obj
未能在您调用它的位置之前出现,这使得返回值默认为type int
,对于operator而言是无效的类型->
。您可能要检查一下。确保symbol_get_obj
通过头文件包含或显式函数原型正确存在的声明。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句