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

Add build script and workflow to validate API headers in C++ #1370

Closed
jphickey opened this issue Feb 24, 2023 · 0 comments · Fixed by #1372
Closed

Add build script and workflow to validate API headers in C++ #1370

jphickey opened this issue Feb 24, 2023 · 0 comments · Fixed by #1372

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
As noted in issue #1365, there is currently no tests to check compatibility of the OSAL API with C++. Although C++ is not an officially targeted platform for OSAL, some users do have C++ code and occasionally the OSAL header files are included from C++ code.

Describe the solution you'd like
This is two parts:

  1. All public OSAL headers should have an conditional extern "C" to handle the case if/when they are included from a C++ file.
  2. There should be a workflow check to confirm that the API header files for OSAL are compliant with C++ 03.

Describe alternatives you've considered
The only other workaround is to insist that the user never include OSAL headers directly from C++, instead provide their own C++ wrapper for the OSAL API. But this is a fairly big thing when a few minor updates can make the OSAL headers more C++-friendly.

Additional context
Note that C++ would still be considered a secondary target here - a workflow can do some simple checks to at least make sure the headers don't contain any declarations that are outright incompatible with C++, but otherwise C++ support would be totally on the user to validate.

Notably - none of the unit tests run in C++.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Feb 24, 2023
jphickey added a commit to jphickey/osal that referenced this issue Feb 24, 2023
Adds a new build and test workflow that includes an API validation with
both C and C++ compilers.  This should catch any cases where syntactical
elements that work in C but do not work in C++ appear in the headers.
jphickey added a commit to jphickey/osal that referenced this issue Feb 24, 2023
Adds a new build and test workflow that includes an API validation with
both C and C++ compilers.  This should catch any cases where syntactical
elements that work in C but do not work in C++ appear in the headers.
jphickey added a commit to jphickey/osal that referenced this issue Feb 24, 2023
Adds a new build and test workflow that includes an API validation with
both C and C++ compilers.  This should catch any cases where syntactical
elements that work in C but do not work in C++ appear in the headers.
dzbaker added a commit that referenced this issue Mar 2, 2023
@dzbaker dzbaker closed this as completed in bb49702 Mar 2, 2023
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants