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

Fix #1141, add typecast to memchr call #1142

Merged

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented Sep 7, 2021

Describe the contribution
This function is documented as returning void*, and on some compilers this requires an explicit cast to const char* to avoid a warning.

Fixes #1141

Testing performed
Build and sanity check CFE

Expected behavior changes
None

System(s) tested on
Ubuntu

Additional context
Isolated from draft contribution from @thesamprice in #1140

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

This function is documented as returning `void*`, and on some compilers
this requires an explicit cast to `const char*` to avoid a warning.
@jphickey
Copy link
Contributor Author

jphickey commented Sep 7, 2021

After further consideration, I think the reason this warning got tripped is because the function in question is an inline, and in the proposed code change it was possibly included from a C++ source file. A void conversion like this is valid in C but in C++ requires a cast.

Nonetheless, this makes the headers C++ compliant so still a valid thing to add.

@astrogeco astrogeco added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Sep 7, 2021
@astrogeco astrogeco changed the base branch from main to integration-candidate September 7, 2021 22:15
@astrogeco
Copy link
Contributor

Do we want to do a "co-authored by" credit?

@thesamprice
Copy link

Do we want to do a "co-authored by" credit?

Doesn't matter to me. Don't make more work than necessary.

@astrogeco astrogeco removed the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Sep 8, 2021
@astrogeco
Copy link
Contributor

CCB:2021-09-08 APPROVED

@astrogeco astrogeco added the CCB:Approved Indicates code review and approval by community CCB label Sep 8, 2021
@astrogeco astrogeco merged commit 101adb4 into nasa:integration-candidate Sep 8, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Sep 8, 2021
nasa/osal#1142, Add typecast to memchr call
astrogeco added a commit to nasa/cFS that referenced this pull request Sep 8, 2021
nasa/osal#1144, Regex update in coverage enforcement to match .0

nasa/osal#1142, Add typecast to memchr call
astrogeco added a commit to nasa/cFS that referenced this pull request Sep 10, 2021
**Combines**

nasa/cFE#1939, v6.8.0-rc1+dev994
nasa/osal#1145, v5.1.0-rc1+dev604
nasa/PSP#307, v1.5.0-rc1+dev124
nasa/sch_lab#87, v2.4.0-rc1+dev47

**Includes**

*cFE*

nasa/cFE#1903, Update directory diagrams in application developer guide

nasa/cFE#1922, SB code coverage improvements #1905, Improve SB coverage

nasa/cFE#1936, Improve ES code coverage

nasa/cFE#1938, Enforce minimum code coverage

nasa/cFE#1940, Update dev guide for MSG and SBR

nasa/cFE#1941, Support unimplemented features in MSG FT

*osal*

nasa/osal#1144, Regex update in coverage enforcement to match .0

nasa/osal#1142, Add typecast to memchr call

*psp*

nasa/PSP#307, check that module type is not invalid

nasa/PSP#306, do not override add_psp_module for coverage test

*sch_lab*

nasa/sch_lab#86, add CmdCode to sch_lab_table

nasa/sch_lab#88, Fix missing typedef

Co-authored-by: Jacob Hageman           <skliper@users.noreply.github.com>
Co-authored-by: Joseph Hickey           <jphickey@users.noreply.github.com>
Co-authored-by: Ariel Adams             <ArielSAdamsNASA@users.noreply.github.com>
Co-authored-by: Jose F Martinez Pedraza <pepepr08@users.noreply.github.com>
@skliper skliper added this to the 6.0.0 milestone Sep 24, 2021
@jphickey jphickey deleted the fix-1141-memchr-cast branch February 23, 2022 18:25
jphickey pushed a commit to jphickey/osal that referenced this pull request Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typecast memcchr in os-shared-common.h
4 participants