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

UT assert stub generator bypasses functions marked extern "C" #1166

Closed
jphickey opened this issue Sep 28, 2021 · 0 comments · Fixed by #1191
Closed

UT assert stub generator bypasses functions marked extern "C" #1166

jphickey opened this issue Sep 28, 2021 · 0 comments · Fixed by #1191

Comments

@jphickey
Copy link
Contributor

jphickey commented Sep 28, 2021

Describe the bug
The generate_stubs.pl script ignores all contents inside {} blocks. Unfortunately, for header files which are made C++-aware, it is typical to wrap C function calls in an extern "C" block which means it gets ignored by the tool. It does not understand the #ifdef __cplusplus surrounding it.

To Reproduce
Attempt to generate stubs against a header file which includes an extern "C" block. The prototypes inside the block are not processed.

Expected behavior
Should process prototypes inside the extern "C" block.

System observed on:
Ubuntu.

Additional context
Prototypes were expected to all occur at the top-most scope but the extern "C" keyword for C++ changes this. Really, the file needs to be run through the C (not C++) preprocessor first, so the #ifdef here has the intended effect.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Sep 28, 2021
@jphickey jphickey added the bug label Sep 28, 2021
jphickey added a commit to jphickey/osal that referenced this issue Sep 28, 2021
Add feature to generate_stubs.pl input phase to recognize and
skip over `#ifdef __cplusplus` blocks.  This makes it so it
can be used on C headers which are C++-enabled too.
jphickey added a commit to jphickey/osal that referenced this issue Sep 28, 2021
Add feature to generate_stubs.pl input phase to recognize and
skip over `#ifdef __cplusplus` blocks.  This makes it so it
can be used on C headers which are C++-enabled too.
jphickey added a commit to jphickey/osal that referenced this issue Sep 28, 2021
Add feature to generate_stubs.pl input phase to recognize and
skip over `#ifdef __cplusplus` blocks.  This makes it so it
can be used on C headers which are C++-enabled too.
@astrogeco astrogeco added this to the cFS-Draco milestone Oct 6, 2021
astrogeco added a commit to astrogeco/osal that referenced this issue Nov 3, 2021
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants