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

typedef for status return values #888

Closed
CDKnightNASA opened this issue Sep 15, 2020 · 0 comments · Fixed by #919 or #936
Closed

typedef for status return values #888

CDKnightNASA opened this issue Sep 15, 2020 · 0 comments · Fixed by #919 or #936
Labels
Milestone

Comments

@CDKnightNASA
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently most CFE API's return a status code (the return type defines as int32.) The numeric return type is somewhat unclear and could result in confusion with other types of information (such as inadvertent confusion with return values from OSAL functions or numeric ID's).

Describe the solution you'd like

typedef int32 CFE_Status_t;

CFE_Status_t CFE_SB_CreatePipe()...

In order to facilitate better coding practices, I also propose a utility function:

bool CFE_Status_IsSuccess(CFE_Status_t status); // returns true if the status is a success return value, false if not (currently < 0 is an error condition, >= 0 is success with possible further status details.)

Describe alternatives you've considered
This will require quite a lot of code change but could be migrated incrementally as creating the typedef to the same type will be compatible. Eventually it could be changed to a struct wrapper or enum or something that will result in compiler errors when the type is considered a numeric type.

Requester Info
[email protected]

@CDKnightNASA CDKnightNASA added the good first issue Good for newcomers label Sep 15, 2020
@yammajamma yammajamma added CCB:Ready Ready for discussion at the Configuration Control Board (CCB) IC-20200916 labels Sep 16, 2020
CDKnightNASA added a commit to CDKnightNASA/cFE that referenced this issue Sep 16, 2020
@yammajamma yammajamma removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) IC-20200916 labels Sep 21, 2020
CDKnightNASA added a commit to CDKnightNASA/cFE that referenced this issue Sep 28, 2020
CDKnightNASA added a commit to CDKnightNASA/cFE that referenced this issue Sep 30, 2020
@astrogeco astrogeco added this to the 7.0.0 milestone Sep 30, 2020
CDKnightNASA added a commit to CDKnightNASA/cFE that referenced this issue Oct 2, 2020
CDKnightNASA added a commit to CDKnightNASA/cFE that referenced this issue Oct 2, 2020
CDKnightNASA added a commit to CDKnightNASA/cFE that referenced this issue Oct 2, 2020
astrogeco added a commit that referenced this issue Oct 2, 2020
Fix #888, Add typedef for function return status codes
astrogeco added a commit to nasa/cFS that referenced this issue Oct 2, 2020
astrogeco added a commit to nasa/cFS that referenced this issue Oct 6, 2020
Combines 
- nasa/cFE#936
- nasa/osal#612

*** 

* Add osal#541

* Add cfe#898

* Add cfe#925

* Add cfe#917

* Add cFE#899

* Add nasa/cFE#888

* Add CFE hotfix for documentation link warnings

* Add FastTracked nasa/osal#616

* Set submodules to main for IC-2020-10-07

Co-authored-by: Joseph Hickey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants