Pro * c问题 [英] Problem with Pro*c

查看:50
本文介绍了Pro * c问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#define XLOG(...)\

做{\

sprintf(SysBuf," [%s] [%s /%d / %s]",curtime(),__ FILE__,

__LINE __,__ FUNCTION__); \\ b \\ b
sprintf(SysBuf + strlen(SysBuf),__ VA_ARGS__); \

xlog(SysBuf); \\ /

} while(0)

我用Pro * c编译,但它给了我错误信息......,

但是,gcc完全正确。如何解决问题

proc错误消息???

第27行第15行语法错误文件../comm/comm.h :

错误在第27行,第15栏中的文件../comm/comm.h

#define XLOG(...)\

............... 1

PCC-S-02014,遇到符号......当期待

之一时:


)标识符,define,elif,else,endif,error,if,ifdef,

ifndef,include,line,pragma,undef,exec,sql,begin,end,

var,type,oracle,一个立即预处理器命令,

a C令牌,创建,功能,包,程序,触发器,或

替换,

符号)用......代替。继续。

#define XLOG( ... ) \
do{ \
sprintf( SysBuf, "[%s][%s/%d/%s] ", curtime(), __FILE__ ,
__LINE__ , __FUNCTION__ ); \
sprintf( SysBuf + strlen( SysBuf ), __VA_ARGS__ ); \
xlog( SysBuf ); \
}while(0)
I compile the with Pro*c, but it gave me the error message... ,
however, it''s totally correct with gcc. How can solve the problem
the proc error message???

Syntax error at line 27, column 15, file ../comm/comm.h:
Error at line 27, column 15 in file ../comm/comm.h
#define XLOG( ... ) \
...............1
PCC-S-02014, Encountered the symbol "..." when expecting one of the
following:

) an identifier, define, elif, else, endif, error, if, ifdef,
ifndef, include, line, pragma, undef, exec, sql, begin, end,
var, type, oracle, an immediate preprocessor command,
a C token, create, function, package, procedure, trigger, or,
replace,
The symbol ")" was substituted for "..." to continue.

推荐答案

empriser写道:
empriser wrote:

#define XLOG (...)
#define XLOG( ... )



这个编译器是C99编译器吗?可变参数宏在C99中引入。


-

Ian Collins。

Is this compiler a C99 compiler? variadic macros were introduced in C99.

--
Ian Collins.


empriser写道:
empriser wrote:

第27行第15行语法错误./comm/comm.h:

第27行第15行出错在文件../comm/comm.h

#define XLOG(...)
Syntax error at line 27, column 15, file ../comm/comm.h:
Error at line 27, column 15 in file ../comm/comm.h
#define XLOG( ... )



尝试删除两边的空格......制作


#define XLOG(...)

Erik

-

+ ---------------------------------------------- ------------- +

Erik de Castro Lopo

+ --------------- -------------------------------------------- +

天才和愚蠢之间的区别在于

天才有其限制。

Try removing the spaces on either side of the "...." to make

#define XLOG(...)

Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
The difference between genius and stupidity is that
genius has its limits.


empriser说:
empriser said:

#define XLOG(...)\

do {\

sprintf(SysBuf," [%s] [% s /%d /%s]",curtime(),__ FILE__,

__LINE __,__ FUNCTION__); \\ b \\ b
sprintf(SysBuf + strlen(SysBuf),__ VA_ARGS__); \

xlog(SysBuf); \\ /

} while(0)


我用Pro * c编译,但它给了我错误信息......,
然而,
,gcc完全正确。
#define XLOG( ... ) \
do{ \
sprintf( SysBuf, "[%s][%s/%d/%s] ", curtime(), __FILE__ ,
__LINE__ , __FUNCTION__ ); \
sprintf( SysBuf + strlen( SysBuf ), __VA_ARGS__ ); \
xlog( SysBuf ); \
}while(0)
I compile the with Pro*c, but it gave me the error message... ,
however, it''s totally correct with gcc.



只是因为gcc有时候并不十分挑剔。它支持广泛的

范围的语法(合成器?),这些语法无效C.关闭这样的

支持可能很困难,但它当然可以完成。 />

Only because gcc isn''t terribly fussy sometimes. It supports a wide
range of syntaxes (syntaces?) which are not valid C. Turning off such
support can be difficult, but it can certainly be done.


如何解决问题
How can solve the problem



摆脱非标准语法。 Pro * C预先编译你的源代码

然后再把它传递给编译器,它比gcc要严格得多

(在我看来这是正确的)。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上述域名中, - www。

Get rid of the non-standard syntax. Pro*C pre-compiles your source code
before passing it on to the compiler, and it''s far stricter than gcc
(and rightly so, in my opinion).

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.


这篇关于Pro * c问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆