You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
All public OSAL headers should have an conditional extern "C" to handle the case if/when they are included from a C++ file.
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.
The text was updated successfully, but these errors were encountered:
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.
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:
extern "C"
to handle the case if/when they are included from a C++ file.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.
The text was updated successfully, but these errors were encountered: