Skip to content

Commit db2e2cd

Browse files
author
Arto Kinnunen
committed
Fix compiler warnings in MDNS service
- the current #pragma pack alignment value is modified - equality comparison with extraneous parentheses
1 parent 924acad commit db2e2cd

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

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_UV6
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: 16 additions & 4 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_UV6 = Used compiler is Keil uVision with armclang.
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_UV6) && FNET_CFG_COMP_UV6)
68+
#define FNET_COMP_STR "UV6"
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,8 +90,12 @@
8590
#elif defined(__ghs__)
8691
#define FNET_CFG_COMP_GHS (1)
8792
#define FNET_COMP_STR "GHS"
88-
/* Keil uVision compiler. */
89-
#elif defined(__CC_ARM)
93+
/* Keil uVision compiler using armclang. */
94+
#elif defined(__CC_ARM) || defined(__ARMCC_VERSION) && defined(__GNUC__)
95+
#define FNET_CFG_COMP_UV6 (1)
96+
#define FNET_COMP_STR "UV6"
97+
/* Keil uVision compiler using armcc. */
98+
#elif defined(__CC_ARM) || defined(__ARMCC_VERSION)
9099
#define FNET_CFG_COMP_UV (1)
91100
#define FNET_COMP_STR "UV"
92101
/* GNU GCC */
@@ -109,6 +118,9 @@
109118
#ifndef FNET_CFG_COMP_CW
110119
#define FNET_CFG_COMP_CW (0)
111120
#endif
121+
#ifndef FNET_CFG_COMP_UV6
122+
#define FNET_CFG_COMP_UV6 (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

0 commit comments

Comments
 (0)