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

Compiler warnings in OSAL #298

Closed
jphickey opened this issue Dec 9, 2019 · 1 comment · Fixed by #334
Closed

Compiler warnings in OSAL #298

jphickey opened this issue Dec 9, 2019 · 1 comment · Fixed by #334
Milestone

Comments

@jphickey
Copy link
Contributor

jphickey commented Dec 9, 2019

Describe the bug
Some warnings still get triggered when building the coverage tests with high strictness flags, as they exercise some API calls that are not even used by the FSW code. So even though the FSW itself builds clean, when the coverage test is added it is no longer clean due to these issues.

To Reproduce
Build OSAL coverage tests with warnings/strictness flags, at least:
-Wall -Werror -std=c99 -pedantic -Wstrict-prototypes -Wcast-align -Wwrite-strings

Expected behavior
Should build warning free.

System observed on:
Ubuntu 18.04 LTS, 64 bit.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@skliper skliper added this to the 5.1.0 milestone Dec 9, 2019
@jphickey
Copy link
Contributor Author

jphickey commented Dec 9, 2019

Specific issues:

  1. The function parameter to OS_FPUExcAttachHandler() needs to actually be a function pointer, not a void* as the C standard does not permit function pointers to be interchanged with data pointers.

  2. The translated_path parameter on OS_ModuleLoad_Impl() should be const, as it does not (and should not) modify this.

  3. The memory pointer in the VxWorks_GlobalMutex_t object should be a void * rather than char * as the specific type of this object is not known.

  4. The call to taskSpawn needs to cast its function pointer parameter. Note the VxWorks definition may simply define this type as int (*FUNCPTR)() (unspecified argument types) which fails when compiling with -Wstrict-prototypes.

jphickey added a commit to jphickey/osal that referenced this issue Dec 9, 2019
Fix warnings that are triggered by compiling the OSAL coverage
unit test with strict settings.

- The OS_FPUExcAttachHandler function needs to be prototyped
  as accepting a function pointer (not void*)
- Const-Correctness on OS_ModuleLoad_Impl()
- Use void* instead of char* for buffer pointer as the specific
  type is not known
- Cast the function passed into taskSpawn on VxWorks
jphickey added a commit to jphickey/osal that referenced this issue Dec 9, 2019
Fix warnings that are triggered by compiling the OSAL coverage
unit test with strict settings.

- The OS_FPUExcAttachHandler function needs to be prototyped
  as accepting a function pointer (not void*)
- Const-Correctness on OS_ModuleLoad_Impl()
- Use void* instead of char* for buffer pointer as the specific
  type is not known
- Cast the function passed into taskSpawn on VxWorks
jphickey added a commit to jphickey/osal that referenced this issue Dec 9, 2019
Additional compiler warning fixes for the UT code itself.
This is committed separately from the changes that affect
the OSAL FSW code.
skliper pushed a commit that referenced this issue Dec 30, 2019
Fix warnings that are triggered by compiling the OSAL coverage
unit test with strict settings.

- The OS_FPUExcAttachHandler function needs to be prototyped
  as accepting a function pointer (not void*)
- Const-Correctness on OS_ModuleLoad_Impl()
- Use void* instead of char* for buffer pointer as the specific
  type is not known
- Cast the function passed into taskSpawn on VxWorks
skliper pushed a commit that referenced this issue Dec 30, 2019
Additional compiler warning fixes for the UT code itself.
This is committed separately from the changes that affect
the OSAL FSW code.
skliper added a commit that referenced this issue Dec 30, 2019
Fix #295, #298, #305, #307, #308,
    #313, #314, #316, #321, #323
Reviewed and approved at 2019-12-18 CCB
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
Development

Successfully merging a pull request may close this issue.

2 participants