Skip to content

Commit 5d29046

Browse files
author
Arto Kinnunen
authored
Merge pull request #2040 from ARMmbed/fix_compiler_warnings
Fix compiler warnings generated by armc6
2 parents 1f63902 + 708a7d5 commit 5d29046

File tree

13 files changed

+35
-18
lines changed

13 files changed

+35
-18
lines changed

source/6LoWPAN/Thread/thread_bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2540,7 +2540,7 @@ int thread_bootstrap_network_data_process(protocol_interface_info_entry_t *cur,
25402540
} else {
25412541
tr_debug("SLAAC address set as NOT preferred.");
25422542
}
2543-
addr_set_preferred_lifetime(cur, e, genericService.P_preferred ? 0xfffffffff : 0);
2543+
addr_set_preferred_lifetime(cur, e, genericService.P_preferred ? 0xffffffff : 0);
25442544
}
25452545
}
25462546
}

source/6LoWPAN/Thread/thread_joiner_application.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,8 @@ static void device_configuration_validate(device_configuration_s *this)
519519
this->vendor_stack_version[1] = (uint8_t)(THREAD_ARM_OUI >> 8);
520520
this->vendor_stack_version[2] = (uint8_t)(THREAD_ARM_OUI);
521521
this->vendor_stack_version[3] = (uint8_t)(THREAD_BUILD_NUMBER >> 4);
522-
this->vendor_stack_version[4] = (uint8_t)(((THREAD_BUILD_NUMBER & 0x0f) << 4) || THREAD_REVISION_NUMBER);
523-
this->vendor_stack_version[5] = (uint8_t)((THREAD_VERSION_MIN << 4) || THREAD_VERSION_MAJ);
522+
this->vendor_stack_version[4] = (uint8_t)(((THREAD_BUILD_NUMBER & 0x0f) << 4) | THREAD_REVISION_NUMBER);
523+
this->vendor_stack_version[5] = (uint8_t)((THREAD_VERSION_MIN << 4) | THREAD_VERSION_MAJ);
524524
}
525525
}
526526

source/DHCPv6_Server/DHCPv6_Server_service.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ void DHCPv6_server_service_timeout_cb(uint32_t timeUpdateInSeconds)
272272
* /param guaPrefix Prefix which will be removed
273273
* /param delete_gua_addresses Whether or not assigned addresses with the prefix should be removed from the interface.
274274
*/
275-
void DHCPv6_server_service_delete(int8_t interface, uint8_t guaPrefix[static 16], bool delete_gua_addresses)
275+
void DHCPv6_server_service_delete(int8_t interface, uint8_t guaPrefix[static 8], bool delete_gua_addresses)
276276
{
277277
dhcpv6_gua_server_entry_s *serverInfo = libdhcpv6_server_data_get_by_prefix_and_interfaceid(interface, guaPrefix);
278278
if (serverInfo) {
@@ -390,7 +390,7 @@ int DHCPv6_server_service_init(int8_t interface, uint8_t guaPrefix[static 16], u
390390

391391
return -1;
392392
}
393-
void DHCPv6_server_service_delete(int8_t interface, uint8_t guaPrefix[static 16], bool delete_gua_addresses)
393+
void DHCPv6_server_service_delete(int8_t interface, uint8_t guaPrefix[static 8], bool delete_gua_addresses)
394394
{
395395
(void) interface;
396396
(void) guaPrefix;

source/DHCPv6_Server/DHCPv6_server_service.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void DHCPv6_server_service_callback_set(int8_t interface, uint8_t guaPrefix[stat
5454
* /param guaPrefix Prefix which will be removed
5555
* /param delete_gua_addresses Whether or not assigned addresses with the prefix should be removed from the interface.
5656
*/
57-
void DHCPv6_server_service_delete(int8_t interface, uint8_t guaPrefix[static 16], bool delete_gua_addresses);
57+
void DHCPv6_server_service_delete(int8_t interface, uint8_t guaPrefix[static 8], bool delete_gua_addresses);
5858

5959

6060
void DHCPv6_server_service_timeout_cb(uint32_t timeUpdateInSeconds);

source/DHCPv6_client/dhcpv6_client_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void dhcp_client_global_address_renew(int8_t interface);
9292
* /param prefix dhcp server ML16 address where address is registered.
9393
*
9494
*/
95-
void dhcp_client_global_address_delete(int8_t interface, uint8_t dhcp_addr[static 16], uint8_t prefix[static 16]);
95+
void dhcp_client_global_address_delete(int8_t interface, uint8_t *dhcp_addr, uint8_t prefix[static 16]);
9696

9797

9898
void dhcp_relay_agent_enable(int8_t interface, uint8_t border_router_address[static 16]);

source/DHCPv6_client/dhcpv6_client_service.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ void dhcp_client_global_address_renew(int8_t interface)
272272
return;
273273
}
274274

275-
void dhcp_client_global_address_delete(int8_t interface, uint8_t dhcp_addr[static 16], uint8_t prefix[static 16])
275+
void dhcp_client_global_address_delete(int8_t interface, uint8_t *dhcp_addr, uint8_t prefix[static 16])
276276
{
277277
protocol_interface_info_entry_t *cur;
278278
dhcpv6_client_server_data_t *srv_data_ptr;

source/Security/TLS/tls_lib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ buffer_t *tls_client_up(buffer_t *buf, sec_suite_t *tls_suite)
11611161
if (tls_header_ptr) {
11621162
if (tls_header_ptr->type == TLS_HANDSHAKE && (tls_heap != 0)) {
11631163
tr_debug("Type:Handshake");
1164-
if ((tls_suite->state == TLS_CHANGE_CHIPHER)) {
1164+
if (tls_suite->state == TLS_CHANGE_CHIPHER) {
11651165
if (tls_header_ptr->length < 32) {
11661166
tr_debug("Too short Chiher Text");
11671167
} else if ((algo_ok & 0x20) && (tls_suite->state == PRF_CALC)) {
@@ -1477,7 +1477,7 @@ buffer_t *tls_server_up(buffer_t *buf, sec_suite_t *tls_suite)
14771477
if (tls_header_ptr) {
14781478
if (tls_header_ptr->type == TLS_HANDSHAKE && (tls_heap != 0)) {
14791479
tr_debug("Type:Handshake");
1480-
if ((tls_suite->state == TLS_CHANGE_CHIPHER)) {
1480+
if (tls_suite->state == TLS_CHANGE_CHIPHER) {
14811481
if (tls_header_ptr->length < 32) {
14821482
tr_debug("Too short Chiher Text");
14831483
} else if ((algo_ok & 0x20) && (tls_suite->state == PRF_CALC)) {

source/Service_Libs/mdns/fnet/fnet_stack/port/compiler/fnet_comp.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**************************************************************************
22
*
3+
* Copyright (c) 2019 Arm Limited and affiliates.
34
* Copyright 2011-2016 by Andrey Butok. FNET Community.
45
* Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc.
56
*
@@ -71,6 +72,11 @@
7172
#define FNET_COMP_PACKED_VAR __packed
7273
#endif
7374

75+
#if FNET_CFG_COMP_CLANG
76+
#define FNET_COMP_PACKED_BEGIN _Pragma("pack(1)")
77+
#define FNET_COMP_PACKED_END _Pragma("pack()")
78+
#endif
79+
7480
#if FNET_CFG_COMP_GNUC
7581
#define FNET_COMP_PACKED_BEGIN _Pragma("pack(1)")
7682
#define FNET_COMP_PACKED_END _Pragma("pack(8)")

source/Service_Libs/mdns/fnet/fnet_stack/port/compiler/fnet_comp_config.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**************************************************************************
22
*
3+
* Copyright (c) 2019 Arm Limited and affiliates.
34
* Copyright 2011-2016 by Andrey Butok. FNET Community.
45
* Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc.
56
*
@@ -40,7 +41,8 @@
4041
* Current version of the FNET supports the following compiler definitions:
4142
* - @c FNET_CFG_COMP_IAR = Used compiler is IAR.
4243
* - @c FNET_CFG_COMP_GNUC = Used compiler is GCC.
43-
* - @c FNET_CFG_COMP_UV = Used compiler is Keil uVision.
44+
* - @c FNET_CFG_COMP_CLANG = Used compiler is Keil uVision with Clang.
45+
* - @c FNET_CFG_COMP_UV = Used compiler is Keil uVision with armcc.
4446
* - @c FNET_CFG_COMP_GHS = Used compiler is Green Hills.
4547
* - @c FNET_CFG_COMP_DCC = Used compiler is Diab.
4648
* - @c FNET_CFG_COMP_CW = Used compiler is CodeWarrior.
@@ -61,7 +63,10 @@
6163
/* GHS compiler. */
6264
#elif (defined(FNET_CFG_COMP_GHS) && FNET_CFG_COMP_GHS)
6365
#define FNET_COMP_STR "GHS"
64-
/* Keil uVision compiler. */
66+
/* Keil uVision compiler with armclang. */
67+
#elif (defined(FNET_CFG_COMP_CLANG) && FNET_CFG_COMP_CLANG)
68+
#define FNET_COMP_STR "CLANG"
69+
/* Keil uVision compiler with armcc. */
6570
#elif (defined(FNET_CFG_COMP_UV) && FNET_CFG_COMP_UV)
6671
#define FNET_COMP_STR "UV"
6772
/* GNU GCC */
@@ -85,7 +90,11 @@
8590
#elif defined(__ghs__)
8691
#define FNET_CFG_COMP_GHS (1)
8792
#define FNET_COMP_STR "GHS"
88-
/* Keil uVision compiler. */
93+
/* Keil uVision compiler using Clang. */
94+
#elif defined(__clang__)
95+
#define FNET_CFG_COMP_CLANG (1)
96+
#define FNET_COMP_STR "CLANG"
97+
/* Keil uVision compiler using armcc. */
8998
#elif defined(__CC_ARM)
9099
#define FNET_CFG_COMP_UV (1)
91100
#define FNET_COMP_STR "UV"
@@ -109,6 +118,9 @@
109118
#ifndef FNET_CFG_COMP_CW
110119
#define FNET_CFG_COMP_CW (0)
111120
#endif
121+
#ifndef FNET_CFG_COMP_CLANG
122+
#define FNET_CFG_COMP_CLANG (0)
123+
#endif
112124
#ifndef FNET_CFG_COMP_UV
113125
#define FNET_CFG_COMP_UV (0)
114126
#endif

source/Service_Libs/mdns/fnet/fnet_stack/services/mdns/fnet_mdns.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**************************************************************************
22
*
3-
* Copyright (c) 2017, Arm Limited and affiliates.
3+
* Copyright (c) 2017, 2019 Arm Limited and affiliates.
44
* Copyright 2016 by Andrey Butok. FNET Community.
55
*
66
***************************************************************************
@@ -1614,7 +1614,7 @@ static const fnet_uint8_t *fnet_mdns_process_response(fnet_mdns_if_t *mdns_if, c
16141614
mdns_if->host_name_conflict_timestamp = fnet_timer_get_ms();
16151615

16161616
/* If in Probing state, change name and try again */
1617-
if((mdns_if->state == FNET_MDNS_STATE_PROBING))
1617+
if(mdns_if->state == FNET_MDNS_STATE_PROBING)
16181618
{
16191619
fnet_mdns_update_name_counter(mdns_if); /* Regenerate name.*/
16201620
}

source/Service_Libs/mdns/fnet_user_config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
/* Environment */
4444
#define FNET_CFG_CPU_LITTLE_ENDIAN (1) // Simulator is big endian, Add HW endianess also, follow target
45-
#define FNET_CFG_COMP_GNUC (1) // select compiler to keep compiler selection happy
4645
#define FNET_CFG_MDNS_MAX (1) // allow only 1 mDNS server, as socket needs to be bound to port 5353
4746
#define FNET_CFG_MDNS_SERVICE_MAX (2) // Allow 2 services per server
4847

test/nanostack/unittest/stub/dhcpv6_client_stub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void dhcp_client_global_address_renew(int8_t interface)
7272
{
7373
}
7474

75-
void dhcp_client_global_address_delete(int8_t interface, uint8_t dhcp_addr[static 16], uint8_t prefix[static 16])
75+
void dhcp_client_global_address_delete(int8_t interface, uint8_t *dhcp_addr, uint8_t prefix[static 16])
7676
{
7777
}
7878

test/nanostack/unittest/stub/dhcpv6_server_service_stub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void DHCPv6_server_service_timeout_cb(uint32_t timeUpdateInSeconds)
8383
* /param guaPrefix Prefix which will be removed
8484
* /param delete_gua_addresses Whether or not assigned addresses with the prefix should be removed from the interface.
8585
*/
86-
void DHCPv6_server_service_delete(int8_t interface, uint8_t guaPrefix[static 16], bool delete_gua_addresses)
86+
void DHCPv6_server_service_delete(int8_t interface, uint8_t guaPrefix[static 8], bool delete_gua_addresses)
8787
{
8888

8989
}

0 commit comments

Comments
 (0)