错误:预期')'在'*'之前'令牌 - 这是什么? [英] error: expected ')' before '*' token -- What is this ?
问题描述
我正在尝试为我的postfix编写一个简单的libspf2插件代码
(milter)
当我尝试编译时,我收到这个无用的错误消息
gcc -g1 -Wall -I / usr / local / include / spf2 -I。 -c mfunc.c
在mfunc.c中包含的文件中:1:
mfunc.c:42:错误:预期'')''在''*'之前'令牌
制作:*** [mfunc.o]错误1
我的mfunc.c已上线42
-----------------------
.. 。 。 。
SPF_result_t spfcheck_s(SPF_request_t * ecm_spf_request,char * ip,
char * helo,char * sender){
SPF_response_t * spf_response = NULL ;
SPF_result_t t;
SPF_request_set_ipv4_str(ecm_spf_request,ip);
SPF_request_set_helo_dom(ecm_spf_request,helo);
SPF_request_set_env_from(ecm_spf_request,sender);
SPF_request_query_mailfrom(ecm_spf_request,& spf_response);
t = SPF_response_result(spf_response);
SPF_response_free(spf_response) ;
返回t;
}
.. 。 。 。
那么可能是什么错误?
谢谢
Ram
PS:
注意垃圾邮件发送者:来吧,给我发垃圾邮件
ra * @ netcore。 co.in
http://ecm.netcore .co.in / spamtrap.html
I am trying to write a simple libspf2 plugin code for my postfix
( milter)
I am getting this unhelpful error message when I try to compile
gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
In file included from mfunc.c:1:
mfunc.c:42: error: expected '')'' before ''*'' token
make: *** [mfunc.o] Error 1
my mfunc.c has on the line 42
-----------------------
.. . . . .
SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
char* helo, char* sender) {
SPF_response_t *spf_response = NULL;
SPF_result_t t;
SPF_request_set_ipv4_str( ecm_spf_request, ip );
SPF_request_set_helo_dom( ecm_spf_request, helo );
SPF_request_set_env_from( ecm_spf_request, sender );
SPF_request_query_mailfrom(ecm_spf_request, &spf_response);
t = SPF_response_result(spf_response);
SPF_response_free(spf_response);
return t;
}
.. . . . .
So what could be the error ?
Thanks
Ram
PS:
Note to Spammers: Go ahead , send me spam
ra*@netcore.co.in
http://ecm.netcore.co.in/spamtrap.html
推荐答案
Ram Prasad< ra ******** **@gmail.comwrites:
Ram Prasad <ra**********@gmail.comwrites:
我正在尝试为我的postfix写一个简单的libspf2插件代码
(milter)
当我尝试编译时,我收到这个无用的错误消息
gcc -g1 -Wall -I / usr / local / include / spf2 -I。 -c mfunc.c
在mfunc.c中包含的文件中:1:
mfunc.c:42:错误:预期'')''在''*'之前'令牌
制作:*** [mfunc.o]错误1
我的mfunc.c已上线42
-----------------------
。 。 。 。 。
SPF_result_t spfcheck_s(SPF_request_t * ecm_spf_request,char * ip,
char * helo,char * sender){
SPF_response_t * spf_response = NULL ;
SPF_result_t t;
SPF_request_set_ipv4_str(ecm_spf_request,ip);
SPF_request_set_helo_dom(ecm_spf_request,helo);
SPF_request_set_env_from(ecm_spf_request,sender);
SPF_request_query_mailfrom(ecm_spf_request,& spf_response);
t = SPF_response_result(spf_response);
SPF_response_free(spf_response) ;
返回t;
}
。 。 。 。 。
那么可能是什么错误?
I am trying to write a simple libspf2 plugin code for my postfix
( milter)
I am getting this unhelpful error message when I try to compile
gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
In file included from mfunc.c:1:
mfunc.c:42: error: expected '')'' before ''*'' token
make: *** [mfunc.o] Error 1
my mfunc.c has on the line 42
-----------------------
. . . . .
SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
char* helo, char* sender) {
SPF_response_t *spf_response = NULL;
SPF_result_t t;
SPF_request_set_ipv4_str( ecm_spf_request, ip );
SPF_request_set_helo_dom( ecm_spf_request, helo );
SPF_request_set_env_from( ecm_spf_request, sender );
SPF_request_query_mailfrom(ecm_spf_request, &spf_response);
t = SPF_response_result(spf_response);
SPF_response_free(spf_response);
return t;
}
. . . . .
So what could be the error ?
将该文件中的所有代码发布,然后第42行。将在上下文中。
甚至从第42行的上面都不明显。----? " ;. 。 。 " ;?或者
SPF_?
Post all the code in that file and then "line 42" will be in context. It
isn''t even apparent from above what IS on line 42. "----"? ". . . "? or
SPF_ ?
>
>
将该文件中的所有代码发布,然后第42行。将在上下文中。
甚至从第42行的上面都不明显。----? " ;. 。 。 " ;?或者
SPF_?
Post all the code in that file and then "line 42" will be in context. It
isn''t even apparent from above what IS on line 42. "----"? ". . . "? or
SPF_ ?
文件在这里
----
#include" mdef.h"
文件* LOGFILE;
/ *
*打开文件(/var/log/milter.log)调试日志
*任何milter代码都可以使用addlog函数打印到日志文件
* /
void opendbglog(void){
LOGFILE = NULL;
LOGFILE = fopen(LOGFILENAME," a");
if(LOGFILE == NULL){
fprintf(stderr,could not open logfile \ n);
退出(1);
}
fprintf(LOGFILE ,打开日志文件\ n;);
setvbuf(LOGFILE,(char *)NULL,_IONBF,0);
}
>
/ *
*调试功能
*使用va_args表示args数量
*
*用法addlog(number_of_arguments,arg1,arg2,arg3,arg4 ...)
* /
void addlog(int num_args,...){
va_list ap;
如果(LOGFILE == NULL)返回;
va_start(ap,num_args);
while(num_args--)fprintf(LOGFILE," %s",va_arg(ap,char *));
va_end(ap);
fprintf(LOGFILE," \ n");
返回;
}
SPF_result_t spfcheck_s(SPF_request_t * ecm_spf_request,char * ip,
char * helo,char * sender ){
SPF_response_t * spf_response = NULL;
SPF_result_t t;
SPF_request_set_ipv4_str(ecm_spf_request,ip);
SPF_request_set_helo_dom(ecm_spf_request,helo);
SPF_request_set_env_from(ecm_spf_request,sender);
SPF_request_query_mailfrom(ecm_spf_request,& spf_response);
t = SPF_response_result( spf_response);
SPF_response_free(spf_response);
返回t;
}
The file is here
----
#include "mdef.h"
FILE* LOGFILE;
/*
* Opens file ( /var/log/milter.log ) for debug log
* any milter code can print to log file using addlog function
*/
void opendbglog(void){
LOGFILE=NULL;
LOGFILE=fopen(LOGFILENAME,"a");
if(LOGFILE==NULL){
fprintf(stderr,"Couldnot open logfile\n");
exit(1);
}
fprintf(LOGFILE,"opened logfile\n");
setvbuf(LOGFILE, (char *)NULL, _IONBF, 0);
}
/*
* Debug function
* using va_args for number of args
*
* usage addlog(number_of_arguments,arg1,arg2,arg3,arg4...)
*/
void addlog(int num_args, ... ) {
va_list ap;
if(LOGFILE == NULL ) return;
va_start(ap,num_args);
while(num_args--) fprintf(LOGFILE," %s ", va_arg(ap,char*));
va_end(ap);
fprintf(LOGFILE,"\n");
return;
}
SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
char* helo, char* sender) {
SPF_response_t *spf_response = NULL;
SPF_result_t t;
SPF_request_set_ipv4_str( ecm_spf_request, ip );
SPF_request_set_helo_dom( ecm_spf_request, helo );
SPF_request_set_env_from( ecm_spf_request, sender );
SPF_request_query_mailfrom(ecm_spf_request, &spf_response);
t = SPF_response_result(spf_response);
SPF_response_free(spf_response);
return t;
}
Ram Prasad< ra ********** @ gmail.comwrites:
Ram Prasad <ra**********@gmail.comwrites:
> ;>
发布该文件中的所有代码,然后第42行。将在上下文中。从第42行的上面来看,它甚至都不明显。----? " ;. 。 。 " ;?或者
SPF_?
>>
Post all the code in that file and then "line 42" will be in context. It
isn''t even apparent from above what IS on line 42. "----"? ". . . "? or
SPF_ ?
文件在这里
----
The file is here
----
* snip *
我加载到一个语法hilited编辑器中,并没有看到明显的语法错误 -
尽管快速扫描我无法手动看到任何内容,我猜猜在mdef.h中可能会有麻烦吗?我假设你包括< stdio.hamongst
其他东西。没有它,一个人真的不能告诉。
尝试注释掉块然后恢复它们以查明
错误。
*snip*
I loaded into a syntax hilited editor and saw no obvious syntax errors -
I cant see anything manually despite a quick scan, I guess there might
be troubles in mdef.h where I assume you are including <stdio.hamongst
other things. Without it one cant really tell.
Try commenting blocks out and then reinstating them to pinpoint the
error.
这篇关于错误:预期')'在'*'之前'令牌 - 这是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!