我有以下 gcc 编译警告
symbol.h:179: note: expected ‘uintptr_t *’ but argument is of type ‘PRECEDENCE’
相应的代码是:
176 void symbol_SetCount(SYMBOL, unsigned long);
177 unsigned long symbol_GetCount(SYMBOL);
178
179 size_t symbol_Ordering(uintptr_t*, SYMBOL);
180
181 void symbol_CheckIndexInRange(int);
182 void symbol_CheckNoVariable(SYMBOL);
SYMBOL 定义为:
typedef size_t SYMBOL
任何努力都将受到高度赞赏。
PRECEDENCE 已修改为:
typedef int *PRECEDENCE;
int symbol_Ordering(PRECEDENCE, SYMBOL);
这是 symbol_Ordering 的一些附加信息:
if (symbol_Equal(propSymbol, eml_Id()))
{ /* Arguments should be nil, propositional */
symbol_SetOrdering(Precedence, fol_Equality(), symbol_Ordering(Precedence, eml_Id()));
return eml_RplacWithOpAndArgs(Atom, fol_Equality(), Args)}
int symbol_ORDERING;
int symbol_GetIncreasedOrderingCounter(void)
{ 返回符号_ORDERING++; }
static __inline__ BOOL symbol_PrecedenceGreater(PRECEDENCE P, SYMBOL S1, SYMBOL S2)
{
return symbol_Ordering((uintptr_t*)P, S1) < symbol_Ordering((uintptr_t*)P, S2);
}
size_t symbol_Ordering(uintptr_t*, SYMBOL);
symbol.h:179: note: expected ‘uintptr_t *’ but argument is of type ‘PRECEDENCE’
The corresponding code is :
176 void symbol_SetCount(SYMBOL, unsigned long);
177 unsigned long symbol_GetCount(SYMBOL);
178
179 size_t symbol_Ordering(uintptr_t*, SYMBOL);
180
181 void symbol_CheckIndexInRange(int);
182 void symbol_CheckNoVariable(SYMBOL);
SYMBOL is defined as:
typedef size_t SYMBOL
Any effort will be highly appreciated.
PRECEDENCE has been modified as:
typedef int *PRECEDENCE;
int symbol_Ordering(PRECEDENCE, SYMBOL);
here is some additional information of symbol_Ordering:
if (symbol_Equal(propSymbol, eml_Id()))
{ /* Arguments should be nil, propositional */
symbol_SetOrdering(Precedence, fol_Equality(), symbol_Ordering(Precedence, eml_Id()));
return eml_RplacWithOpAndArgs(Atom, fol_Equality(), Args)}
int symbol_ORDERING;
int symbol_GetIncreasedOrderingCounter(void)
{
return symbol_ORDERING++;
}
static __inline__ BOOL symbol_PrecedenceGreater(PRECEDENCE P, SYMBOL S1, SYMBOL S2)
{
return symbol_Ordering((uintptr_t*)P, S1) < symbol_Ordering((uintptr_t*)P, S2);
}
size_t symbol_Ordering(uintptr_t*, SYMBOL);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您有多个
symbol_Ordering
声明 - 一个声明采用uintptr_t*
,另一个声明采用int*
。uintptr_t*
和int*
不是同一类型(一个是有符号的,一个是无符号的),所以不要这样做。使类型匹配。It looks like you have multiple declarations of
symbol_Ordering
- one that takes auintptr_t*
and one that takes anint*
.uintptr_t*
andint*
aren't the same type (one is signed, one is unsigned), so don't do that. Make the types match.