[英]GCC error: expected ‘)’ before <function protoyprmeter> parameter
In a header file 在头文件中
extern void Trace_Communication(communicationBlock_t mdbMessage);
gives error: expected ')' before 'mdbMessage'
给出
error: expected ')' before 'mdbMessage'
I am sure that communicationBlock_t
is in scope (and reliaze that it would be more efficient to pass a pointer) 我确定
communicationBlock_t
在范围内(并确保传递指针会更有效)
If I copy the declaration of communicationBlock_t
just before the extern
offending line, the error is 如果我在
extern
违规行之前复制了communicationBlock_t
的声明,则错误是
error: conflicting types for ‘communicationBlock_t’
note: previous declaration of ‘communicationBlock_t’ was here
Which seems to imply that the offending line has access to the declaration of communicationBlock_t
这似乎暗示有问题的行可以访问
communicationBlock_t
的声明
I guess that I am overlooking something trivial and obvious, but I have been coding all night and can no longer think straight ... 我想我忽略了一些琐碎而明显的事情,但是我整夜都在编码,再也无法直觉...
What am I doing wrong? 我究竟做错了什么? Thanks 1 ,000,000
谢谢1,000,000
Update: my guess is that it's an include file tangle ... 更新:我的猜测是这是一个包含文件纠结...
typedef struct
{
communicationMessage_t message;
uint8_t length;
#ifdef TESTING
char commandName[32]; // for testing porpoises
DoRunTimeChecks runTimeCheckCallback;
#endif
} communicationBlock_t;
Looks to me like you're using a variable as a type name. 在我看来,您正在使用变量作为类型名称。 What does the declaration of
communicationBlock_t
look like? communicationBlock_t
的声明是什么样的?
Sorry, folks. 抱歉,伙计们。 It was, as I suspected a deady embrace in #include files
因为我怀疑#include文件中有致命的拥抱
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.