我有以下 gcc 编译警告

发布于 2024-08-25 00:10:39 字数 1310 浏览 6 评论 0原文

  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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

再见回来 2024-09-01 00:10:40

看起来您有多个 symbol_Ordering 声明 - 一个声明采用 uintptr_t* ,另一个声明采用 int*uintptr_t*int* 不是同一类型(一个是有符号的,一个是无符号的),所以不要这样做。使类型匹配。

It looks like you have multiple declarations of symbol_Ordering - one that takes a uintptr_t* and one that takes an int*. uintptr_t* and int* aren't the same type (one is signed, one is unsigned), so don't do that. Make the types match.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文