【发布时间】:2020-03-31 18:59:25
【问题描述】:
我有一些 C 代码,其中包含一个专有遗留应用程序的标头。我无法修改标题。我收到以下代码的夹板解析错误:
#if defined(HAS_LONGLONG)
/* removed for brevity */
#elif defined(HAS_INT64)
/* removed for brevity */
#else
typedef union {
int32 l[2]; /* This is the line that is causing the parse error in splint */
double d;
} int64;
#endif
我可以将任何参数传递给夹板以使其正常工作吗?
平台是 64 位,但旧版应用程序是 32 位。
我正在运行夹板:
[me@host]$ splint -I/path/to/include -preprox -warnposix
Splint 3.1.1 --- 28 Apr 2003
/path/to/include/some_header.h:7:10:
Parse Error. (For help on parse errors, see splint -help parseerrors.)
*** Cannot continue.
如果没有 -preprox 和 -warnposix,我会在旧版标头中遇到很多其他错误。
【问题讨论】:
-
你介意显示
int32吗? -
@JL2210 是
typedef int int32; -
如果你通过
-Dint32=int会发生什么? -
@JL2210 成功了,谢谢。您介意发布一个带有解释的答案,我会奖励给您吗?
-
那里。我还提供了常见问题解答的链接以供将来参考。