Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros not being properly hidden from CMock's parser #985

Open
mvandervoord opened this issue Jan 13, 2025 · 2 comments
Open

Macros not being properly hidden from CMock's parser #985

mvandervoord opened this issue Jan 13, 2025 · 2 comments

Comments

@mvandervoord
Copy link
Member

mvandervoord commented Jan 13, 2025

For example, a header containing this:

#ifndef ASSERT
#define ASSERT(c)                                                    \
    do                                                               \
    {                                                                \
        if (!(c))                                                    \
        {                                                            \
            printf("Assertion failed at %s:%d", __FILE__, __LINE__); \
            raise(SIGABRT);                                          \
            assert(0);                                               \
        }                                                            \
    } while (0)
#endif  // ASSERT

Results in this:

🧨 EXCEPTION: CMock >> Failed Parsing Declaration Prototype!
  declaration: 'assert(0)'
  modifier: ''
  return: {:type => '', :name => 'cmock_to_return', :str => ' cmock_to_return', :void? => false, :ptr? => false, :const? => false, :const_ptr? => false}
  function: 'assert'
  args: [{:ptr? => false, :const? => false, :const_ptr? => false, :name => 'cmock_arg1', :type => '0'}]
🌱 Ceedling could not complete operations because of errors

(reported by @elagil as spinoff of issue #981)

@elagil
Copy link

elagil commented Jan 14, 2025

I got version 1.0.1 and enabled the preprocessor. Now, the error went away. 🚀

@mvandervoord
Copy link
Member Author

Glad to hear that! I'm going to leave this open, because Ceedling should be able to handle this without the preprocessor running as well. Thanks for all your work, though. I'm glad your setup is working again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants