You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Various warnings on CentOS 7 when BUILDTYPE=release:
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c: In function ‘CFE_SB_TransmitMsg’:
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c:1433:16: error: ‘RouteId’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
Status = CFE_SB_TransmitBufferFull(BufDscPtr, RouteId, MsgId);
^
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c: In function ‘CFE_SB_SendMsg’:
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c:1433:16: error: ‘RouteId’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c:1395:25: note: ‘RouteId’ was declared here
CFE_SBR_RouteId_t RouteId;
^
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c: In function ‘CFE_SB_PassMsg’:
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c:1433:16: error: ‘RouteId’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
Status = CFE_SB_TransmitBufferFull(BufDscPtr, RouteId, MsgId);
^
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c:1395:25: note: ‘RouteId’ was declared here
CFE_SBR_RouteId_t RouteId;
^
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c: In function ‘CFE_SB_RcvMsg’:
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c:2045:43: error: ‘RcvStatus’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
CFE_EVS_SendEventWithAppID(CFE_SB_Q_RD_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB_Global.AppId,
^
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c:1823:28: note: ‘RcvStatus’ was declared here
int32 RcvStatus;
^
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c: In function ‘CFE_SB_ReceiveBuffer’:
/home/jhageman/cFS/cFS-GitHub/cfe/fsw/cfe-core/src/sb/cfe_sb_api.c:2045:43: error: ‘RcvStatus’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
CFE_EVS_SendEventWithAppID(CFE_SB_Q_RD_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB_Global.AppId,
^
Describe the solution you'd like
Initialize variables where needed
Describe alternatives you've considered
None
Additional context
Compiler warnings, vs static analysis warnings reported in #1185
Requester Info
Jacob Hageman - NASA/GSFC
The text was updated successfully, but these errors were encountered:
Corrects two false alarms about uninitialized vars and another
cast-align warning on the raspbian toolchain (gcc 4.9.3) or
other older versions of gcc (e.g. RHEL/CentOS 7).
- Promotes the CFE_SBR_INVALID_ROUTE_ID constant from the private
cfe_sbr_priv.h header to the public cfe_sbr.h header (where the
type itself is defined).
- Pre-Initialize local stack variables that store outputs from other
functions (avoids false warning about use-before-init).
- Corrects an alignment warning on ARM.
In the event that CFE_SB_TransmitMsgValidate fails, make sure
all outputs are also written as safe/known (but invalid) values.
This is just in case the calling function does not check the
status response and uses the output value anyway (which would
be wrong, but this is just another layer of protection if
it does happen).
Is your feature request related to a problem? Please describe.
Various warnings on CentOS 7 when BUILDTYPE=release:
Describe the solution you'd like
Initialize variables where needed
Describe alternatives you've considered
None
Additional context
Compiler warnings, vs static analysis warnings reported in #1185
Requester Info
Jacob Hageman - NASA/GSFC
The text was updated successfully, but these errors were encountered: