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

Build errors when using extended headers #1982

Closed
jphickey opened this issue Sep 29, 2021 · 1 comment · Fixed by #1983 or #1989
Closed

Build errors when using extended headers #1982

jphickey opened this issue Sep 29, 2021 · 1 comment · Fixed by #1983 or #1989

Comments

@jphickey
Copy link
Contributor

Describe the bug
In Caelum when setting set(MISSION_INCLUDE_CCSDSEXT_HEADER TRUE) to use extended headers, I get a build error due to duplicate typedef of the MSG types:

cfe/modules/msg/option_inc/default_cfe_msg_hdr_priext.h:83:3: error: conflicting types for ‘CFE_MSG_Message_t’
   83 | } CFE_MSG_Message_t;
      |   ^~~~~~~~~~~~~~~~~
cfe/modules/core_api/fsw/inc/cfe_msg_api_typedefs.h:104:31: note: previous declaration of ‘CFE_MSG_Message_t’ was here
  104 | typedef union CFE_MSG_Message CFE_MSG_Message_t;
      |                               ^~~~~~~~~~~~~~~~~

To Reproduce
Enable extended headers in Caelum config, and build.

Expected behavior
Build should succeed.

Code snips
This is because the "typedef" cannot be in both places. In contrast, the standard header (non-extended) defines only the union/struct, not typedef'ed:

union CFE_MSG_Message
{
CCSDS_SpacePacket_t CCSDS; /**< \brief CCSDS Header (Pri or Pri + Ext) */
uint8 Byte[sizeof(CCSDS_SpacePacket_t)]; /**< \brief Byte level access */
};

Whereas the extended header version has a typedef:

typedef union
{
CCSDS_SpacePacket_t CCSDS; /**< \brief CCSDS Header (Pri or Pri + Ext) */
uint8 Byte[sizeof(CCSDS_SpacePacket_t)]; /**< \brief Byte level access */
} CFE_MSG_Message_t;

System observed on:
Ubuntu

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Sep 29, 2021
@jphickey jphickey added the bug label Sep 29, 2021
jphickey added a commit to jphickey/cFE that referenced this issue Sep 29, 2021
Do not double-typedef the CFE_MSG types when using extended headers.
This also corrects a call to UT_SetForceFail in the extended
header test, which was renamed.
@jphickey jphickey changed the title Duplicate typedef when using extended headers Build errors when using extended headers Sep 29, 2021
@jphickey
Copy link
Contributor Author

There is also a build error due to calling a function in the test code that has been renamed (also addressed by same PR).

astrogeco added a commit that referenced this issue Oct 6, 2021
Fix #1982, extended header definitions and test updates
@skliper skliper added this to the Draco milestone Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants