Clean Up Remaining Warnings

Now our example BSP builds to completion and you’ll have already replaced as much of the QNX 6.5.0 BSP code as possible with the equivalent updated versions found in the existing QNX SDP 6.6 BSPs. At this point, you should be able to generate an IFS image from your BSP and test it on your target hardware. However, before doing that, you may notice that there are several warnings generated when you compile the BSP source this final time. The following output shows the list of warnings generated when you compile the QNX 6.5.0 SabreLite BSP example in its current state:

/root/bsps/sabrelite_650/src/hardware/deva/ctrl/mx/mxssi_dll.c: In function 'mx_capture_trigger':
/root/bsps/sabrelite_650/src/hardware/deva/ctrl/mx/mxssi_dll.c:414:13: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
/root/bsps/sabrelite_650/src/hardware/deva/ctrl/mx/mxssi_dll.c: In function 'mx_capture_trigger2':
/root/bsps/sabrelite_650/src/hardware/deva/ctrl/mx/mxssi_dll.c:714:13: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/mmcsd.c: In function 'mmc_dump':
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/mmcsd.c:83:7: warning: variable 'skipping' set but not used [-Wunused-but-set-variable]
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/mmcsd.c: In function 'mmc_erase':
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/mmcsd.c:187:16: warning: variable 'ext' set but not used [-Wunused-but-set-variable]
sim_bs.c: In function 'mx6dq_detect':
sim_bs.c:36:14: warning: variable 'mx35' set but not used [-Wunused-but-set-variable]
sim_bs.c: In function 'bs_dinit':
sim_bs.c:112:14: warning: variable 'mx35' set but not used [-Wunused-but-set-variable]
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/sim_mmc.c: In function 'mmc_evpd_inquiry':
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/sim_mmc.c:278:17: warning: variable 'is' set but not used [-Wunused-but-set-variable]
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/sim_mmc.c: In function 'mmc_fake_inquiry':
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/sim_mmc.c:407:16: warning: variable 'ext' set but not used [-Wunused-but-set-variable]
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/sim_mmc.c: In function 'mmc_pio_initiate':
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/sim_mmc.c:941:11: warning: variable 'blkno' set but not used [-Wunused-but-set-variable]
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/chipsets/sim_mx35.c: In function 'mx35_command':
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/chipsets/sim_mx35.c:257:18: warning: variable 'intrstien' set but not used 
     [-Wunused-but-set-variable]
/root/bsps/sabrelite_650/src/hardware/devb/mmcsd/chipsets/sim_mx35.c:256:18: warning: variable 'intrsten' set but not used 
     [-Wunused-but-set-variable]
../../fujitsu/f29f100_ident.c: In function 'f3s_f29f100_ident':
../../fujitsu/f29f100_ident.c:52:34: warning: variable 'amd_mult' set but not used [-Wunused-but-set-variable]
../../intel/i28f008_suspend.c: In function 'f3s_i28f008_suspend':
../../intel/i28f008_suspend.c:44:11: warning: variable 'status' set but not used [-Wunused-but-set-variable]
/root/qnx660/host/linux/x86/usr/bin/ntoarmv7-ar: creating /root/bsps/sabrelite_650/src/hardware/flash/mtd-flash/arm/a.le.v7/libmtd-flash.a
/root/qnx660/host/linux/x86/usr/bin/ntoarmv7-ar: creating /root/bsps/sabrelite_650/src/hardware/ipl/lib/arm/a.le.v7/libipl.a
/root/bsps/sabrelite_650/src/hardware/ipl/boards/mx6q-sabrelite/fat-fs.c:39:1: warning: conflicting types for built-in function 'memcpy' 
     [enabled by default]
/root/bsps/sabrelite_650/src/hardware/ipl/boards/mx6q-sabrelite/fat-fs.c:339:1: warning: 'read_cluster' defined but not used 
     [-Wunused-function]
/root/bsps/sabrelite_650/src/hardware/spi/mx51ecspi/mxecspi.c: In function 'mx51_options':
/root/bsps/sabrelite_650/src/hardware/spi/mx51ecspi/mxecspi.c:204:20: warning: variable 'err' set but not used [-Wunused-but-set-variable]
/root/qnx660/host/linux/x86/usr/bin/ntoarmv7-ar: creating /root/bsps/sabrelite_650/src/hardware/startup/lib/arm/a.le.v7/libstartup.a
/root/bsps/sabrelite_650/src/utils/r/rtc/qnxrtc.c: In function 'main':
/root/bsps/sabrelite_650/src/utils/r/rtc/qnxrtc.c:487:6: warning: format '%ld' expects argument of type 'long int', but argument 2 
     has type '_Int32t' [-Wformat]
/root/bsps/sabrelite_650/src/utils/r/rtc/qnxrtc.c:487:6: warning: format '%ld' expects argument of type 'long int', but argument 3 
     has type '_Uint32t' [-Wformat]
/root/bsps/sabrelite_650/src/utils/r/rtc/qnxrtc.c:496:7: warning: format '%ld' expects argument of type 'long int', but argument 2 
     has type '_Uint32t' [-Wformat]

As indicated earlier, warnings that didn't appear when the same BSP was compiled in a QNX 6.5.0 environment but appear when the same code is compiled in a QNX SDP 6.6.0 environment are due to the updated GNU toolchain (QNX 6.5.0 and QNX 6.5.1 SP1 uses version 4.4.2, which was updated to version 4.7.3 in QNX SDP 6.6). Typically, the gcc compiler becomes more strict about coding practices with each updated version. Many of the warnings seen in the output above relate to variables or functions that are declared, but not subsequently used. Other warnings relate to typecasting and to general coding practices.

Note: Since the GNU toolchain is widely used in computing environments outside of QNX, considerable information exists on the internet that describes in detail how to fix the warnings that appear when you compile your updated BSP, so we won’t go into that level of detail here.