Hello,
We’re starting a new project on PIC32, and intend on using a more up-to-date compiler version than we’ve been standardized on for the past few years. XC32 version 3.01+ is really GCC 8.3.1.
While FreeRTOS+FAT has compiled without problem on XC32 2.50 (GCC 4.8.3), there are a number of warnings kicked out by GCC 8.3.1 related to strings.
Currently using FreeRTOS+FAT 191128, but I have tried FreeRTOS+FAT 2.3.3 with the same warnings.
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c: In function 'FF_Open':
In file included from ../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/include/ff_headers.h:51,
from ../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c:37:
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/include/ff_string.h:103:41: warning: 'strncpy' specified bound 250 equals destination size [-Wstringop-truncation]
#define STRNCPY( target, src, maxlen ) strncpy( ( target ), ( src ), ( maxlen ) );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c:263:3: note: in expansion of macro 'STRNCPY'
STRNCPY( pcFileName, pcPath + xIndex + 1, ffconfigMAX_FILENAME );
^~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/include/ff_string.h:103:41: warning: 'strncpy' specified bound 250 equals destination size [-Wstringop-truncation]
#define STRNCPY( target, src, maxlen ) strncpy( ( target ), ( src ), ( maxlen ) );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c:263:3: note: in expansion of macro 'STRNCPY'
STRNCPY( pcFileName, pcPath + xIndex + 1, ffconfigMAX_FILENAME );
^~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_stdio.c: In function 'prvABSPath':
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_stdio.c:1992:95: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
snprintf( pxWorkingDirectory->pcFileName, sizeof( pxWorkingDirectory->pcFileName ), "%s/%s", pxWorkingDirectory->pcCWD, pcPath );
^
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_stdio.c:1992:5: note: 'snprintf' output 2 or more bytes (assuming 251) into a destination of size 250
snprintf( pxWorkingDirectory->pcFileName, sizeof( pxWorkingDirectory->pcFileName ), "%s/%s", pxWorkingDirectory->pcCWD, pcPath );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c: In function 'FF_SetTime':
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/include/ff_string.h:103:41: warning: 'strncpy' specified bound 250 equals destination size [-Wstringop-truncation]
#define STRNCPY( target, src, maxlen ) strncpy( ( target ), ( src ), ( maxlen ) );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c:2633:3: note: in expansion of macro 'STRNCPY'
STRNCPY( pcFileName, ( pcPath + xIndex + 1 ), ffconfigMAX_FILENAME );
^~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/include/ff_string.h:103:41: warning: 'strncpy' specified bound 250 equals destination size [-Wstringop-truncation]
#define STRNCPY( target, src, maxlen ) strncpy( ( target ), ( src ), ( maxlen ) );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c:2633:3: note: in expansion of macro 'STRNCPY'
STRNCPY( pcFileName, ( pcPath + xIndex + 1 ), ffconfigMAX_FILENAME );
^~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c: In function 'FF_SetPerm':
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/include/ff_string.h:103:41: warning: 'strncpy' specified bound 250 equals destination size [-Wstringop-truncation]
#define STRNCPY( target, src, maxlen ) strncpy( ( target ), ( src ), ( maxlen ) );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c:2723:2: note: in expansion of macro 'STRNCPY'
STRNCPY( pcFileName, ( pcPath + xIndex + 1 ), ffconfigMAX_FILENAME );
^~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/include/ff_string.h:103:41: warning: 'strncpy' specified bound 250 equals destination size [-Wstringop-truncation]
#define STRNCPY( target, src, maxlen ) strncpy( ( target ), ( src ), ( maxlen ) );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c:2723:2: note: in expansion of macro 'STRNCPY'
STRNCPY( pcFileName, ( pcPath + xIndex + 1 ), ffconfigMAX_FILENAME );
^~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c: In function 'FF_Move':
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/include/ff_string.h:103:41: warning: 'strncpy' specified bound 250 equals destination size [-Wstringop-truncation]
#define STRNCPY( target, src, maxlen ) strncpy( ( target ), ( src ), ( maxlen ) );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c:890:6: note: in expansion of macro 'STRNCPY'
STRNCPY( xMyFile.pcFileName, ( szDestinationFile + xIndex + 1 ), ffconfigMAX_FILENAME );
^~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/include/ff_string.h:103:41: warning: 'strncpy' specified bound 250 equals destination size [-Wstringop-truncation]
#define STRNCPY( target, src, maxlen ) strncpy( ( target ), ( src ), ( maxlen ) );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_file.c:890:6: note: in expansion of macro 'STRNCPY'
STRNCPY( xMyFile.pcFileName, ( szDestinationFile + xIndex + 1 ), ffconfigMAX_FILENAME );
^~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_dir.c: In function 'FF_CreateFile':
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_dir.c:2870:3: warning: 'strncpy' specified bound 250 equals destination size [-Wstringop-truncation]
strncpy( xMyFile.pcFileName, pcFileName, ffconfigMAX_FILENAME );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_dir.c: In function 'FF_MkDir':
../FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/ff_dir.c:3044:4: warning: 'strncpy' specified bound 250 equals destination size [-Wstringop-truncation]
strncpy( xMyDirectory.pcFileName, pcDirName, ffconfigMAX_FILENAME );
Looking these over, some of them appear to be legitimate errors. Curious to hear thoughts on these warnings.
Thanks!