Skip to content

Commit

Permalink
Fix #30: avoid compile warnings due to printf format
Browse files Browse the repository at this point in the history
When using printf-style format conversions one must generally
cast the argument to the intended type, as it does not happen
implicitly with variable-argument functions.

In particular the existing code worked on the default (native) build
but generated warnings when building on RTEMS for a 32-bit x86 target.
  • Loading branch information
jphickey authored and skliper committed Dec 30, 2019
1 parent 693d75f commit 67fac46
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions fsw/src/sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ int32 SAMPLE_AppInit( void )
CFE_EVS_BINARY_FILTER);
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Sample App: Error Registering Events, RC = 0x%08X\n",
status);
CFE_ES_WriteToSysLog("Sample App: Error Registering Events, RC = 0x%08lX\n",
(unsigned long)status);
return ( status );
}

Expand All @@ -187,8 +187,8 @@ int32 SAMPLE_AppInit( void )
Sample_AppData.PipeName);
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Sample App: Error creating pipe, RC = 0x%08X\n",
status);
CFE_ES_WriteToSysLog("Sample App: Error creating pipe, RC = 0x%08lX\n",
(unsigned long)status);
return ( status );
}

Expand All @@ -199,8 +199,8 @@ int32 SAMPLE_AppInit( void )
Sample_AppData.SAMPLE_CommandPipe);
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to HK request, RC = 0x%08X\n",
status);
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to HK request, RC = 0x%08lX\n",
(unsigned long)status);
return ( status );
}

Expand All @@ -211,8 +211,8 @@ int32 SAMPLE_AppInit( void )
Sample_AppData.SAMPLE_CommandPipe);
if (status != CFE_SUCCESS )
{
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to Command, RC = 0x%08X\n",
status);
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to Command, RC = 0x%08lX\n",
(unsigned long)status);

return ( status );
}
Expand All @@ -228,7 +228,7 @@ int32 SAMPLE_AppInit( void )
if ( status != CFE_SUCCESS )
{
CFE_ES_WriteToSysLog("Sample App: Error Registering \
Table, RC = 0x%08X\n", status);
Table, RC = 0x%08lX\n", (unsigned long)status);

return ( status );
}
Expand Down Expand Up @@ -539,7 +539,7 @@ void SAMPLE_GetCrc( const char *TableName )
else
{
Crc = TblInfoPtr.Crc;
CFE_ES_WriteToSysLog("Sample App: CRC: 0x%08X\n\n", Crc);
CFE_ES_WriteToSysLog("Sample App: CRC: 0x%08lX\n\n", (unsigned long)Crc);
}

return;
Expand Down

0 comments on commit 67fac46

Please sign in to comment.