fix:修复-Werror编译选项产生的告警

清理框架定义未使用告警,宏重定义,以及变量定义未使用等告警。

Close #I68RLA

Signed-off-by: liuwenxin <liuwenxin11@huawei.com>
This commit is contained in:
liuwenxin 2023-01-04 16:08:01 +08:00
parent f7af2cdf9b
commit 52bc16c3db
31 changed files with 49 additions and 134 deletions

View File

@ -352,15 +352,10 @@ LITE_TEST_CASE(CmsisFuncTestSuite, TestCmsis004, Function | MediumTest | Level1)
ret = strcmp(staticBuff, strbuff);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
ret = osMessageQueueDelete(msgQueueId);
ICUNIT_ASSERT_EQUAL(ret, osOK, ret);
#endif
return LOS_OK;
EXIT:
ret = osMessageQueueDelete(msgQueueId);
ICUNIT_ASSERT_EQUAL(ret, osOK, ret);
#endif
return LOS_OK;
}

View File

@ -46,7 +46,7 @@ static VOID TaskF01(VOID)
ICUNIT_ASSERT_EQUAL_VOID(g_testAtomicID03, i, g_testAtomicID03);
ICUNIT_ASSERT_EQUAL_VOID(ret, g_testAtomicID03, ret);
LOS_AtomicAdd(&g_testCount, 1);
LOS_AtomicAdd((Atomic *)(&g_testCount), 1);
}
static UINT32 TestCase(VOID)

View File

@ -33,7 +33,7 @@
#include "osTest.h"
#include "It_los_event.h"
static VOID TaskF01()
static VOID TaskF01(VOID)
{
UINT32 ret;

View File

@ -47,6 +47,7 @@ static int g_uwIndex;
#else
#define TEST_MAX_NUMBER_HWI (OS_USER_HWI_MAX - HWI_NUM_INT0)
#define TEST_HWI_COUNT (TEST_MAX_NUMBER_HWI - 2)
#undef HWI_NUM_INT0
#define HWI_NUM_INT0 HWI_NUM_INT1
#endif

View File

@ -43,6 +43,7 @@ static VOID HwiF01(VOID)
return;
}
#undef HWI_NUM_INT0
#define HWI_NUM_INT0 HWI_NUM_TEST1
static UINT32 Testcase(VOID)
{

View File

@ -33,7 +33,7 @@
#include "los_timer.h"
#include "los_sched.h"
#define myprintf // printf
#define myprintf printf
#define TEST_LOOP 5
static EVENT_CB_S g_pmTestEvent;
static UINT32 g_taskID1, g_taskID2;

View File

@ -36,6 +36,15 @@ EVENT_CB_S g_eventCB0;
EVENT_CB_S g_eventCB1;
EVENT_CB_S g_eventCB2;
EVENT_CB_S g_eventCB3;
UINT32 g_swtmrId1;
UINT32 g_swtmrId2;
UINT32 g_swtmrId3;
UINT32 g_swtmrCountA;
UINT32 g_swtmrCountB;
UINT32 g_swtmrCountC;
UINT32 g_uwsTick1;
UINT32 g_uwsTick2;
UINT32 g_uwsTick3;
VOID ItSuiteLosSwtmr(void)
{

View File

@ -56,17 +56,17 @@ extern EVENT_CB_S g_eventCB3;
extern UINT32 g_idleTaskID;
static UINT32 g_swtmrId1;
static UINT32 g_swtmrId2;
static UINT32 g_swtmrId3;
extern UINT32 g_swtmrId1;
extern UINT32 g_swtmrId2;
extern UINT32 g_swtmrId3;
static UINT32 g_swtmrCountA;
static UINT32 g_swtmrCountB;
static UINT32 g_swtmrCountC;
extern UINT32 g_swtmrCountA;
extern UINT32 g_swtmrCountB;
extern UINT32 g_swtmrCountC;
static UINT32 g_uwsTick1;
static UINT32 g_uwsTick2;
static UINT32 g_uwsTick3;
extern UINT32 g_uwsTick1;
extern UINT32 g_uwsTick2;
extern UINT32 g_uwsTick3;
extern VOID LOS_GetCpuTick(UINT32 *puwCntHi, UINT32 *puwCntLo);
extern VOID ItSuiteLosSwtmr(VOID);

View File

@ -48,7 +48,7 @@ static VOID Case1(UINT32 arg)
return;
}
static VOID Case2()
static VOID Case2(VOID)
{
UINT32 ret;

View File

@ -44,7 +44,7 @@ static VOID Case1(UINT32 arg)
return;
}
static VOID Case2()
static VOID Case2(VOID)
{
UINT32 ret;
UINT32 uwloop = 1000;

View File

@ -41,7 +41,7 @@ static VOID Case1(UINT32 arg)
g_testCount = 30;
}
static VOID Case2()
static VOID Case2(VOID)
{
// 10, Here, assert that g_testCount is equal to this .
ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 10, g_testCount);
@ -49,7 +49,7 @@ static VOID Case2()
g_testCount = 20;
}
static VOID Case3()
static VOID Case3(VOID)
{
// 10, Set the number to determine whether the process is as expected.
g_testCount = 10;

View File

@ -51,7 +51,7 @@ EXIT:
LOS_TaskDelete(g_testTaskID01);
}
static VOID Case2()
static VOID Case2(VOID)
{
UINT32 ret;

View File

@ -50,14 +50,14 @@ static VOID Case1(UINT32 arg)
g_testCount = 10;
}
static VOID Case2()
static VOID Case2(VOID)
{
// 20, Here, assert that g_testCount is equal to this .
ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 20, g_testCount);
g_testCount++;
}
static VOID Case3()
static VOID Case3(VOID)
{
UINT32 index;

View File

@ -33,7 +33,7 @@
#include "It_los_swtmr.h"
static VOID Case1()
static VOID Case1(VOID)
{
UINT32 ret;
@ -43,7 +43,7 @@ static VOID Case1()
}
}
static VOID Case2()
static VOID Case2(VOID)
{
UINT32 ret;
@ -53,7 +53,7 @@ static VOID Case2()
}
}
static VOID Case3()
static VOID Case3(VOID)
{
UINT32 ret;
@ -64,7 +64,7 @@ static VOID Case3()
}
}
VOID Case4()
static VOID Case4(VOID)
{
UINT32 ret;
@ -77,7 +77,7 @@ VOID Case4()
}
}
VOID Case5()
static VOID Case5(VOID)
{
UINT32 ret;
@ -90,7 +90,7 @@ VOID Case5()
}
}
VOID Case6()
static VOID Case6(VOID)
{
UINT32 ret;

View File

@ -41,6 +41,7 @@ mqd_t g_mqueueId[LOSCFG_BASE_IPC_QUEUE_CONFIG + 1];
SEM_HANDLE_T g_mqueueSem;
mqd_t g_messageQId;
mqd_t g_gqueue;
TSK_HANDLE_T g_mqueueTaskPID;
VOID TestAssertWaitDelay(UINT32 *testCount, UINT32 flag)
{

View File

@ -57,18 +57,19 @@
#define MQUEUE_PRIORITY_TEST 0
#define MQUEUE_TIMEOUT_TEST 7
#define MQUEUE_PRIORITY_NUM_TEST 3
#define MQUEUE_MAX_NUM_TEST (LOSCFG_BASE_IPC_QUEUE_CONFIG - QUEUE_EXISTED_NUM)
#define MQ_MAX_MSG_NUM 16
#define MQ_MAX_MSG_LEN 64
#undef HWI_NUM_TEST
#define HWI_NUM_TEST 1
#undef HWI_NUM_TEST1
#define HWI_NUM_TEST1 2
#if (LOSCFG_LIBC_NEWLIB == 1)
#define MQ_PRIO_MAX 1
#endif
#undef LOSCFG_BASE_IPC_QUEUE_CONFIG
#define LOSCFG_BASE_IPC_QUEUE_CONFIG 1024
#define LOS_AtomicInc(a) (++*(a))
#define MqueueTaskDelay(tick) (usleep((tick) * 10000))
@ -91,7 +92,7 @@ typedef UINT32 SEM_HANDLE_T ;
extern SEM_HANDLE_T g_mqueueSem;
static TSK_HANDLE_T g_mqueueTaskPID;
extern TSK_HANDLE_T g_mqueueTaskPID;
extern CHAR g_gqname[MQUEUE_STANDARD_NAME_LENGTH];
extern CHAR g_mqueueName[LOSCFG_BASE_IPC_QUEUE_CONFIG + 1][MQUEUE_STANDARD_NAME_LENGTH];
extern mqd_t g_mqueueId[LOSCFG_BASE_IPC_QUEUE_CONFIG + 1];

View File

@ -34,8 +34,6 @@ static UINT32 Testcase(VOID)
CHAR qname[MQUEUE_STANDARD_NAME_LENGTH] = "";
const CHAR *msgptr = MQUEUE_SEND_STRING_TEST;
mqd_t queue;
INT32 unresolved = 0;
INT32 failure = 0;
INT32 ret = 0;
ret = snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \

View File

@ -34,8 +34,6 @@ static UINT32 Testcase(VOID)
CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH], msgrv[MQUEUE_STANDARD_NAME_LENGTH];
mqd_t mqdes;
struct mq_attr attr = {0};
INT32 unresolved = 0;
INT32 failure = 0;
INT32 ret = 0;
ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \

View File

@ -35,8 +35,6 @@ static UINT32 Testcase(VOID)
mqd_t mqdes;
CHAR msgrv[MQUEUE_STANDARD_NAME_LENGTH];
struct mq_attr attr = {0};
INT32 unresolved = 0;
INT32 failure = 0;
INT32 ret = 0;
ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \

View File

@ -34,8 +34,6 @@ static UINT32 Testcase(VOID)
CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = "";
mqd_t mqdes;
struct mq_attr mqstat;
INT32 unresolved = 0;
INT32 failure = 0;
INT32 ret = 0;
ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \

View File

@ -34,8 +34,6 @@ static UINT32 Testcase(VOID)
CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = "";
mqd_t mqdes;
struct mq_attr mqstat, nmqstat;
INT32 unresolved = 0;
INT32 failure = 0;
INT32 ret = 0;
ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \

View File

@ -35,8 +35,6 @@ static UINT32 Testcase(VOID)
mqd_t mqdes;
struct mq_attr mqstat = {0};
struct mq_attr nmqstat = {0};
INT32 unresolved = 0;
INT32 failure = 0;
INT32 ret = 0;
ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \

View File

@ -38,23 +38,7 @@
#include "semaphore.h"
#include "unistd.h"
#ifdef LOSCFG_DEBUG_DEADLOCK
#define TEST_MUTEX_INIT \
{ \
{ 0, 0, 0, 0 }, \
{ \
{ 0, 0 }, { 0, 0 }, 0, 0 \
} \
}
#else
#define TEST_MUTEX_INIT \
{ \
{ 0, 0, 0, 0 }, \
{ \
{ 0, 0 }, 0, 0 \
} \
}
#endif
#define TEST_MUTEX_INIT {0}
#define MUTEX_TEST_DEFAULT_PRIO LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO
#define MUTEX_TEST_HIGH_PRIO (MUTEX_TEST_DEFAULT_PRIO - 6)

View File

@ -42,11 +42,6 @@
#include "mqueue.h"
#include "signal.h"
/* Some routines are part of the XSI Extensions */
#ifndef WITHOUT_XOPEN
#define _XOPEN_SOURCE 600
#endif
#define PTHREAD_IS_ERROR (-1)
#define PTHREAD_PRIORITY_TEST 20
#define PTHREAD_DEFAULT_STACK_SIZE (LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE)
@ -71,9 +66,6 @@
/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
#define _POSIX_C_SOURCE 200112L
#define PTHREAD_MUTEX_RECURSIVE 0
#define PTHREAD_MUTEX_ERRORCHECK 0
#define PRIORITY_OTHER (-1)
#define PRIORITY_FIFO 20
#define PRIORITY_RR 20

View File

@ -102,7 +102,7 @@ char *g_strType[] = {
"FUNCTION", "PRESSURE", "PERFORMANCE"
};
iUINT32 ICunitRunF()
iUINT32 ICunitRunF(void)
{
iUINT32 idx, idx1;
ICUNIT_CASE_S *psubCaseArray;

View File

@ -231,7 +231,7 @@ void TestCmsis2(void)
}
#endif
VOID TestTaskEntry()
VOID TestTaskEntry(VOID)
{
PRINTF("\t\n --- Test Start --- \n\n");
ICunitInit();

View File

@ -68,7 +68,10 @@ static_library("posix_test") {
sources += [ "src/fs/posix_fs_func_test.c" ]
}
if (!defined(LOSCFG_COMPILER_ICCARM)) {
cflags = [ "-Wno-error" ]
cflags = [
"-Wno-error",
"-Wno-unused-function",
]
} else {
cflags = [ "--no_warnings" ]
}

View File

@ -1,56 +0,0 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef COMMON_TEST_H
#define COMMON_TEST_H
#define TESTCOUNT_NUM_1 1
#define TESTCOUNT_NUM_2 2
#define TESTCOUNT_NUM_3 3
#define TESTCOUNT_NUM_4 4
#define TESTCOUNT_NUM_5 5
#define DELAY_TICKS_1 1
#define DELAY_TICKS_5 5
#define DELAY_TICKS_10 10
#define TEST_TASK_STACK_SIZE 0x600
#define TASK_LOOP_NUM 0x10000000
#define TEST_TIME 10
#define THREAD_COUNT_MIN 3
#define THREAD_COUNT_MAX 30
#define THREAD_STACK_SPACE_MAX 4096
#ifdef __cplusplus
#if __cplusplus
#endif
#endif /* __cplusplus */
#endif

View File

@ -42,8 +42,6 @@
#define DELAY_TICKS_5 5
#define DELAY_TICKS_10 10
#define TEST_TASK_STACK_SIZE 0x600
#define TASK_LOOP_NUM 0x10000000
#define TEST_TIME 10
#define THREAD_COUNT_MIN 3
#define THREAD_COUNT_MAX 30

View File

@ -33,7 +33,6 @@
#include "posix_test.h"
#include <mqueue.h>
#include <fcntl.h>
#include "common_test.h"
#include "kernel_test.h"
#include "log.h"

View File

@ -34,7 +34,6 @@
#include "hctest.h"
#include "los_config.h"
#include "cmsis_os2.h"
#include "common_test.h"
#include "kernel_test.h"
#include "pthread.h"
#include "log.h"