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

fails to build under Raspbian - alignment of pointers #38

Closed
CDKnightNASA opened this issue Jan 29, 2020 · 3 comments · Fixed by #43 or #47
Closed

fails to build under Raspbian - alignment of pointers #38

CDKnightNASA opened this issue Jan 29, 2020 · 3 comments · Fixed by #43 or #47
Assignees
Labels
bug Something isn't working
Milestone

Comments

@CDKnightNASA
Copy link
Contributor

Describe the bug
Trying to build under Raspbian, sample_app fails with "cast increases required alignment of target type" errors.

/home/pi/cFS/apps/sample_app/fsw/src/sample_app.c:365:25: error: cast increases required alignment of target type [-Werror=cast-align]
     CFE_SB_TimeStampMsg((CFE_SB_Msg_t *) &Sample_AppData.SAMPLE_HkTelemetryPkt);
                         ^
/home/pi/cFS/apps/sample_app/fsw/src/sample_app.c:366:20: error: cast increases required alignment of target type [-Werror=cast-align]
     CFE_SB_SendMsg((CFE_SB_Msg_t *) &Sample_AppData.SAMPLE_HkTelemetryPkt);

To Reproduce
Build on Raspbian.

Expected behavior
Should not cause warnings/errors.

Code snips

System observed on:
Raspberry Pi Zero W

Additional context
Add any other context about the problem here.

Reporter Info
[email protected]

@CDKnightNASA CDKnightNASA self-assigned this Jan 29, 2020
@CDKnightNASA
Copy link
Contributor Author

Note that CFE_SB_InitMsg() takes a void *, whereas TimeStampMsg and SendMsg take CFE_SB_MsgPtr_t. I'm guessing InitMsg should be updated to use CFE_SB_MsgPtr_t.

@jphickey
Copy link
Contributor

See also nasa/cFE#440 about the API inconsistency here.

@jphickey
Copy link
Contributor

The alignment warnings are the same general issue as in nasa/cFE#313. If you want you can assign this to me and just turn off -Wcast-align in your build for now.

jphickey added a commit to jphickey/sample_app that referenced this issue Mar 2, 2020
Put the HkTlm buffer into a union to ensure it is aligned
appropriately for conversion to a CFE_SB_Msg_t type.
astrogeco pushed a commit that referenced this issue Mar 9, 2020
Put the HkTlm buffer into a union to ensure it is aligned
appropriately for conversion to a CFE_SB_Msg_t type.
@astrogeco astrogeco mentioned this issue Mar 10, 2020
@astrogeco astrogeco added the bug Something isn't working label Oct 1, 2020
@astrogeco astrogeco added this to the 1.2.0 milestone Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants