Open kaimac1 opened 8 years ago
Interesting.
First, I must admit I've never thought to pass a compound literal as an argument like this in C. That being said, I'm not sure why it wouldn't work as normal. I suspect it has something to do with the way compound literals are handled inside macros. I suspect that since macros are processed before the compound literal, it's taking it apart ahead of time?
For now, you can assign these to a variable ahead of time... I'll have to see if there is anything we can do about this long-term (based on where the problem is).
:)
When passing a compound literal to a function that takes a struct argument, CMock gets confused about the number of arguments that were passed.
It seems to somehow be interpreting each member of the compound literal as a separate argument. Adding the next member of the struct gives '... passed 4 arguments, but takes just 2'.