AnsweredAssumed Answered

build warning of MQX 4.2.0.2

Question asked by Bing Li on Feb 8, 2017
Latest reply on Mar 2, 2017 by Bing Li

hello


I'm using MQX 4.2.0.2 run on FRDM-K64F.
And build MQX using KDS3.0

I import the below 4 original MQX project into KDS,
and build them in release mode as the following.

・bsp_frdmk64f
・psp_frdmk64f
・rtcs_frdmk64f
・shell_frdmk64f


build log of [bsp_frdmk64f] and [psp_frdmk64f] is well.
But [rtcs_frdmk64f] and [shell_frdmk64f] have some warning.

Details are as follows.

 


[rtcs_frdmk64f] build warning log:


-----------------------------------------------------------------------------------------------------------------

..\..\..\..\source\nat\dnat.c: In function 'DNAT_lookup_rule':
..\..\..\..\source\nat\dnat.c:92:75: warning: 'destination_port' may be used uninitialized in this function [-Wmaybe-uninitialized]
             if ((destination_port >= element_ptr->RULE.PUBLIC_START_PORT) &&
                                                                           ^

..\..\..\..\source\nat\dnat.c:98:71: warning: 'source_port' may be used uninitialized in this function [-Wmaybe-uninitialized]
                 (source_port >= element_ptr->RULE.PRIVATE_START_PORT) && 
                                                                       ^

..\..\..\..\source\nat\natevent.c: In function 'NAT_expire':
..\..\..\..\source\nat\natevent.c:176:48: warning: 'tmp_nat_event_ptr' may be used uninitialized in this function [-Wmaybe-uninitialized]
       tcpip_event_ptr->TIME = tmp_nat_event_ptr->TIME;
                                                ^

..\..\..\..\source\nat\natdata.c: In function 'NAT_insert':
..\..\..\..\source\nat\natdata.c:230:18: warning: 'key' may be used uninitialized in this function [-Wmaybe-uninitialized]
    IPRADIX_insert(&nat_cfg_ptr->ROOT_IN, key, 0xFFFFFFFF, nat_cfg_ptr->RADIX_IN,
                  ^

..\..\..\..\source\if\rtcsrand.c: In function 'kiss_gen_seed':
..\..\..\..\source\if\rtcsrand.c:64:17: warning: type of 'x' defaults to 'int' [enabled by default]
 static uint32_t kiss_gen_seed(x, y)
                 ^
..\..\..\..\source\if\rtcsrand.c:64:17: warning: type of 'y' defaults to 'int' [enabled by default]


..\..\..\..\source\nat\nat_apply.c: In function 'NAT_mod_ip':
..\..\..\..\source\nat\nat_apply.c:367:28: warning: unused variable 'nat_cfg_ptr' [-Wunused-variable]
    NAT_CFG_STRUCT_PTR      nat_cfg_ptr = RTCS_getcfg(NAT);
                            ^

..\..\..\..\source\nat\nat_apply.c: In function 'NAT_mod_icmp':
..\..\..\..\source\nat\nat_apply.c:649:63: warning: value computed is not used [-Wunused-value]
             mqx_htons(transport.ECHO_PTR->SEQ, nat_session_ptr->PRV_PORT);
                                                               ^

..\..\..\..\source\nat\nat_apply.c:653:63: warning: value computed is not used [-Wunused-value]
             mqx_htons(transport.ECHO_PTR->SEQ, nat_session_ptr->NAT_PORT);
                                                               ^
-----------------------------------------------------------------------------------------------------------------


[shell_frdmk64f] build warning log:

-----------------------------------------------------------------------------------------------------------------

..\..\..\..\source\rtcs\sh_ppp.c: In function 'sh_ppp_start':
\freescale_mqx_4_2\shell\source\include\sh_rtcs.h:92:19: warning: 'error' may be used uninitialized in this function [-Wmaybe-uninitialized]
        do {fprintf( _file, "%s"_format "%s", PPP_PRINT_PREFIX, ##__VA_ARGS__, "\n" );} while( 0 )
                   ^
..\..\..\..\source\rtcs\sh_ppp.c:245:24: note: 'error' was declared here
     uint32_t           error;
                        ^
-----------------------------------------------------------------------------------------------------------------

 

Should I ignore these warnings or fix them?

If need to fix, can someone provide an official(NXP) amendment?

Thanks.

Outcomes