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

Cast align issue in cfe_es_task.c - CFE_ES_TaskPipe #854

Closed
skliper opened this issue Aug 31, 2020 · 3 comments · Fixed by #917
Closed

Cast align issue in cfe_es_task.c - CFE_ES_TaskPipe #854

skliper opened this issue Aug 31, 2020 · 3 comments · Fixed by #917
Assignees
Labels
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Aug 31, 2020

Describe the bug

/home/jhageman/cFS-GitHub/cfe/fsw/cfe-core/src/es/cfe_es_task.c: In function ‘CFE_ES_TaskPipe’:
/home/jhageman/cFS-GitHub/cfe/fsw/cfe-core/src/es/cfe_es_task.c:635:52: warning: cast increases required alignment of target type [-Wcast-align]
  635 |                         CFE_ES_SendMemPoolStatsCmd((CFE_ES_SendMemPoolStats_t*)Msg);

To Reproduce
Build on gcc 8+ with cast-align=strict

Expected behavior
Clean build

Code snips

case CFE_ES_SEND_MEM_POOL_STATS_CC:
if (CFE_ES_VerifyCmdLength(Msg, sizeof(CFE_ES_SendMemPoolStats_t)))
{
CFE_ES_SendMemPoolStatsCmd((CFE_ES_SendMemPoolStats_t*)Msg);
}
break;

System observed on:

  • Hardware: arm64
  • OS: Ubuntu 20.04
  • Versions bundle + mods to cast-align=strict

Additional context
#851, #852

Reporter Info
Jacob Hageman - NASA/GSFC

@skliper
Copy link
Contributor Author

skliper commented Aug 31, 2020

@jphickey are you fixing this with the other mempool command issues (reference instead of raw address)?

@jphickey
Copy link
Contributor

Yes, the reason this message has increased alignment needs is because it contains a cpuaddr type. When replaced with an abstract pool handle (which can be uint32) the alignment issue goes away.

@skliper skliper added this to the 7.0.0 milestone Sep 9, 2020
@skliper skliper added the bug label Sep 9, 2020
@jphickey jphickey linked a pull request Sep 30, 2020 that will close this issue
@skliper
Copy link
Contributor Author

skliper commented Jan 6, 2021

Confirmed this has been resolved (via #917). Closing

@skliper skliper closed this as completed Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants