Closed bw35 closed 1 year ago
We can put this on pile of: CMock only has a regexp and not a whole preprocessor. As a workaround: run your header files through the preprocessor to avoid such syntaxes.
PS: static
variable in header file? I hope whoever wrote that burns in hell, since next guy including this file will have to go through it.
Thanks for the suggested workaround
PS: Maybe you didn't note the const static. The compiler computes the value at compile time and uses it directly when optimization is on. Much like a #define, but typed. No memory is allocated, unless the address of the constant is taken.
Fixed in PR #420
The following statement in a header file causes CMock to raise an exception when generating mocks:
Without the parentheses, CMock runs fine. Of course the parentheses can be omitted in this simple case, but in other situations with more complex expressions they are required.