【发布时间】:2012-03-14 00:38:51
【问题描述】:
我有一段代码在编译时给了我这个警告
#define SKM_sk_set_cmp_func(type, st,cmp) \
((int (*)(const type * const *,const type * const *)) \
sk_set_cmp_func(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_SK_CMP_FUNC(type, cmp)))
#define sk_X509_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509, (st), (cmp))
static int mrs_X509_cmp_callback(const X509 **a, const X509 **b);
int foo()
{
STACK_OF(X509) *certs;
(void)sk_X509_set_cmp_func(certs, mrs_X509_cmp_callback);
}
In function foo:
warning: pointer type mismatch in conditional expression
你们能告诉我如何摆脱警告信息吗?
【问题讨论】:
-
不知道它们是什么类型?机会很大。
-
sk_X509_set_cmp_func()的原型是什么?你是怎么声明certs的? -
永远不要在 C++ 和 C 中标记这样的问题。
-
我编辑了代码以包含 sk_X509_set_cmp_func() 的原型
标签: c compiler-construction compilation compiler-errors compiler-warnings