Skip to content

Commit 917cf26

Browse files
authored
Remove redundant attributes from LogV implementation (#33984)
The function was already declared with ENFORCE_FORMAT(3, 0), so there is no need to repeat this attribute in the definition.
1 parent 6cf8de8 commit 917cf26

File tree

14 files changed

+36
-38
lines changed

14 files changed

+36
-38
lines changed

src/platform/ESP32/Logging.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <platform/logging/LogV.h>
44

55
#include <lib/core/CHIPConfig.h>
6-
#include <lib/support/EnforceFormat.h>
76
#include <lib/support/logging/Constants.h>
87

98
#include <stdio.h>
@@ -19,7 +18,7 @@ namespace chip {
1918
namespace Logging {
2019
namespace Platform {
2120

22-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
21+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
2322
{
2423
char tag[11];
2524

src/platform/Linux/Logging.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* See Project CHIP LICENSE file for licensing information. */
22

3+
#include <platform/logging/LogV.h>
4+
35
#include <lib/core/CHIPConfig.h>
4-
#include <lib/support/EnforceFormat.h>
56
#include <lib/support/logging/Constants.h>
6-
#include <platform/logging/LogV.h>
77

88
#include <cinttypes>
99
#include <cstdio>
@@ -35,7 +35,7 @@ namespace Platform {
3535
/**
3636
* CHIP log output functions.
3737
*/
38-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
38+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
3939
{
4040
struct timeval tv;
4141

src/platform/NuttX/Logging.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* See Project CHIP LICENSE file for licensing information. */
22

3+
#include <platform/logging/LogV.h>
4+
35
#include <lib/core/CHIPConfig.h>
4-
#include <lib/support/EnforceFormat.h>
56
#include <lib/support/logging/Constants.h>
6-
#include <platform/logging/LogV.h>
77

88
#include <cinttypes>
99
#include <cstdio>
@@ -35,7 +35,7 @@ namespace Platform {
3535
/**
3636
* CHIP log output functions.
3737
*/
38-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
38+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
3939
{
4040
struct timeval tv;
4141

src/platform/Tizen/Logging.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
* limitations under the License.
1616
*/
1717

18+
#include <platform/logging/LogV.h>
19+
1820
#include <cstdint>
1921
#include <cstdio>
2022

2123
#include <dlog.h>
2224

2325
#include <lib/core/CHIPConfig.h>
24-
#include <lib/support/EnforceFormat.h>
2526
#include <lib/support/logging/Constants.h>
26-
#include <platform/logging/LogV.h>
2727

2828
namespace chip {
2929
namespace Logging {
@@ -32,7 +32,7 @@ namespace Platform {
3232
/**
3333
* CHIP log output functions.
3434
*/
35-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
35+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
3636
{
3737
static constexpr char kLogTag[] = "CHIP";
3838

src/platform/Zephyr/Logging.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <platform/logging/LogV.h>
44

55
#include <lib/core/CHIPConfig.h>
6-
#include <lib/support/EnforceFormat.h>
76
#include <lib/support/logging/Constants.h>
87

98
#include <zephyr/kernel.h>
@@ -42,7 +41,7 @@ namespace Platform {
4241
* CHIP log output function.
4342
*/
4443

45-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
44+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
4645
{
4746
char formattedMsg[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];
4847
snprintfcb(formattedMsg, sizeof(formattedMsg), "[%s]", module);

src/platform/logging/impl/android/Logging.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/* See Project chip LICENSE file for licensing information. */
22

3-
#include <lib/support/EnforceFormat.h>
4-
#include <lib/support/logging/Constants.h>
53
#include <platform/logging/LogV.h>
64

5+
#include <lib/support/logging/Constants.h>
6+
77
#include <android/log.h>
88

99
namespace chip {
1010
namespace Logging {
1111
namespace Platform {
1212

13-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
13+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
1414
{
1515
int priority = (category == kLogCategory_Error) ? ANDROID_LOG_ERROR : ANDROID_LOG_DEBUG;
1616
__android_log_vprint(priority, module, msg, v);

src/platform/logging/impl/stdio/Logging.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/* See Project CHIP LICENSE file for licensing information. */
22

3-
#include <lib/support/EnforceFormat.h>
4-
#include <lib/support/logging/Constants.h>
53
#include <platform/logging/LogV.h>
64

5+
#include <lib/support/logging/Constants.h>
6+
77
#include <stdio.h>
88

99
namespace chip {
1010
namespace Logging {
1111
namespace Platform {
1212

13-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
13+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
1414
{
1515
printf("CHIP:%s: ", module);
1616
vprintf(msg, v);

src/platform/logging/impl/stdio/darwin/Logging.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
* limitations under the License.
1616
*/
1717

18+
#include <platform/logging/LogV.h>
19+
1820
#include <lib/core/CHIPConfig.h>
19-
#include <lib/support/EnforceFormat.h>
2021
#include <lib/support/logging/Constants.h>
21-
#include <platform/logging/LogV.h>
2222
#include <pthread.h>
2323
#include <stdio.h>
2424
#include <sys/time.h>
@@ -28,7 +28,7 @@ namespace chip {
2828
namespace Logging {
2929
namespace Platform {
3030

31-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
31+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
3232
{
3333
timeval time;
3434
gettimeofday(&time, nullptr);

src/platform/mbed/Logging.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
* Logging implementation for Mbed platform
2222
*/
2323

24-
#include <lib/core/CHIPConfig.h>
25-
#include <lib/support/EnforceFormat.h>
26-
#include <lib/support/logging/CHIPLogging.h>
27-
#include <lib/support/logging/Constants.h>
2824
#include <platform/logging/LogV.h>
2925

3026
#include <stdio.h>
3127
#include <string.h>
3228

29+
#include <lib/core/CHIPConfig.h>
30+
#include <lib/support/logging/CHIPLogging.h>
31+
#include <lib/support/logging/Constants.h>
32+
3333
#include "mbed-trace/mbed_trace.h"
3434

3535
#ifdef MBED_TRACE_FILTER_LENGTH
@@ -66,7 +66,7 @@ char logMsgBuffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];
6666
/**
6767
* CHIP log output functions.
6868
*/
69-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
69+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
7070
{
7171
size_t prefixLen = 0;
7272
snprintf(logMsgBuffer, sizeof(logMsgBuffer), "[%s]", module);

src/platform/nxp/k32w/k32w0/Logging.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
#include <platform/logging/LogV.h>
44

5+
#include <cstring>
56
#include <inttypes.h>
7+
68
#include <lib/core/CHIPConfig.h>
79
#include <lib/support/EnforceFormat.h>
810
#include <lib/support/logging/Constants.h>
911
#include <platform/CHIPDeviceConfig.h>
1012
#include <src/lib/support/CodeUtils.h>
1113

1214
#include "fsl_debug_console.h"
13-
#include <cstring>
1415

1516
#define K32W_LOG_MODULE_NAME chip
1617
#define EOL_CHARS "\r\n" /* End of Line Characters */
@@ -128,7 +129,7 @@ namespace Platform {
128129
/**
129130
* CHIP log output function.
130131
*/
131-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
132+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
132133
{
133134
(void) module;
134135
(void) category;

src/platform/nxp/k32w/k32w1/Logging.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ namespace Platform {
146146
/**
147147
* CHIP log output function.
148148
*/
149-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
149+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
150150
{
151151
(void) module;
152152
(void) category;

src/platform/openiotsdk/Logging.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
* for Open IOT SDK platform.
2323
*/
2424

25+
#include <platform/logging/LogV.h>
26+
2527
#include <lib/core/CHIPConfig.h>
26-
#include <lib/support/EnforceFormat.h>
2728
#include <lib/support/logging/CHIPLogging.h>
2829
#include <lib/support/logging/Constants.h>
29-
#include <platform/logging/LogV.h>
3030

3131
#include <stdio.h>
3232
#include <string.h>
@@ -50,7 +50,7 @@ namespace Platform {
5050
/**
5151
* CHIP log output functions.
5252
*/
53-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
53+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
5454
{
5555
char logMsgBuffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];
5656

src/platform/qpg/Logging.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include <lib/core/CHIPConfig.h>
77
#include <lib/support/CHIPPlatformMemory.h>
8-
#include <lib/support/EnforceFormat.h>
98
#include <lib/support/logging/Constants.h>
109
#include <platform/CHIPDeviceConfig.h>
1110
#include <system/SystemClock.h>
@@ -67,7 +66,7 @@ static size_t AddTimeStampAndPrefixStr(char * logBuffer, const char * prefix, si
6766
* CHIP log output function.
6867
*/
6968

70-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
69+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
7170
{
7271
char formattedMsg[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];
7372
size_t formattedMsgLen;

src/platform/webos/Logging.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* See Project CHIP LICENSE file for licensing information. */
22

3-
#include <lib/support/EnforceFormat.h>
4-
#include <lib/support/logging/Constants.h>
53
#include <platform/logging/LogV.h>
64

75
#include <cinttypes>
@@ -10,6 +8,8 @@
108
#include <sys/time.h>
119
#include <unistd.h>
1210

11+
#include <lib/support/logging/Constants.h>
12+
1313
#ifdef USE_SYSLOG
1414
#include <syslog.h>
1515
#endif
@@ -33,7 +33,7 @@ namespace Platform {
3333
/**
3434
* CHIP log output functions.
3535
*/
36-
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
36+
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
3737
{
3838
struct timeval tv;
3939

0 commit comments

Comments
 (0)