[bsp] Make all warnings into errors with qemu-vexpress-a9 qemu-virt64… (#5785)

* [bsp] Make all warnings into errors with qemu-vexpress-a9 qemu-virt64-aarch64 and stm32f411-st-nucleo.
* [RTC] Fix compile errors
This commit is contained in:
Yang sheng 2022-04-09 00:39:00 +08:00 committed by GitHub
parent 084bb1c956
commit eb2fc60207
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 22 deletions

View File

@ -57,7 +57,7 @@ if PLATFORM == 'gcc':
STRIP = PREFIX + 'strip'
DEVICE = ' -march=armv7-a -marm -msoft-float'
CFLAGS = DEVICE + ' -Wall'
CFLAGS = DEVICE + ' -Wall -Werror'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__ -I.'
LINK_SCRIPT = 'link.lds'
LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors'+\

View File

@ -39,7 +39,7 @@ if PLATFORM == 'gcc':
OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -g -march=armv8-a -mtune=cortex-a53'
CFLAGS = DEVICE + ' -Wall'
CFLAGS = DEVICE + ' -Wall -Werror'
AFLAGS = ' -c' + ' -x assembler-with-cpp -D__ASSEMBLY__'
LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors -T link.lds'
CPATH = ''

View File

@ -44,7 +44,7 @@ if PLATFORM == 'gcc':
OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -Dgcc'
CFLAGS = DEVICE + ' -Dgcc' + ' -Wall -Werror'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'

View File

@ -39,15 +39,6 @@
typedef struct rt_alarm *rt_alarm_t;
typedef void (*rt_alarm_callback_t)(rt_alarm_t alarm, time_t timestamp);
/* used for low level RTC driver */
struct rt_rtc_wkalarm
{
rt_bool_t enable; /* 0 = alarm disabled, 1 = alarm enabled */
rt_int32_t tm_sec; /* alarm at tm_sec */
rt_int32_t tm_min; /* alarm at tm_min */
rt_int32_t tm_hour; /* alarm at tm_hour */
};
struct rt_alarm
{
rt_list_t list;

View File

@ -28,6 +28,15 @@ extern "C" {
#define RT_DEVICE_CTRL_RTC_GET_ALARM (RT_DEVICE_CTRL_BASE(RTC) + 0x05) /**< get alarm */
#define RT_DEVICE_CTRL_RTC_SET_ALARM (RT_DEVICE_CTRL_BASE(RTC) + 0x06) /**< set alarm */
/* used for alarm function */
struct rt_rtc_wkalarm
{
rt_bool_t enable; /* 0 = alarm disabled, 1 = alarm enabled */
rt_int32_t tm_sec; /* alarm at tm_sec */
rt_int32_t tm_min; /* alarm at tm_min */
rt_int32_t tm_hour; /* alarm at tm_hour */
};
struct rt_rtc_ops
{
rt_err_t (*init)(void);

View File

@ -748,7 +748,6 @@ void rt_alarm_dump(void)
{
rt_list_t *next;
rt_alarm_t alarm;
rt_uint8_t index = 0;
rt_kprintf("| hh:mm:ss | week | flag | en |\n");
rt_kprintf("+----------+------+------+----+\n");

View File

@ -191,19 +191,19 @@ static void thread1_recv_static_mb(void *arg)
rt_err_t result = RT_EOK;
result = rt_mb_recv(&test_static_mb, (rt_ubase_t *)&mb_recv_str1, RT_WAITING_FOREVER);
if (result != RT_EOK || strcmp(mb_recv_str1, mb_send_str1) != 0)
if (result != RT_EOK || rt_strcmp((const char *)mb_recv_str1, (const char *)mb_send_str1) != 0)
{
uassert_false(1);
}
result = rt_mb_recv(&test_static_mb, (rt_ubase_t *)&mb_recv_str2, RT_WAITING_FOREVER);
if (result != RT_EOK || strcmp(mb_recv_str2, mb_send_str2) != 0)
if (result != RT_EOK || rt_strcmp((const char *)mb_recv_str2, (const char *)mb_send_str2) != 0)
{
uassert_false(1);
}
result = rt_mb_recv(&test_static_mb, (rt_ubase_t *)&mb_recv_str3, RT_WAITING_FOREVER);
if (result != RT_EOK || strcmp(mb_recv_str3, mb_send_str3) != 0)
if (result != RT_EOK || rt_strcmp((const char *)mb_recv_str3, (const char *)mb_send_str3) != 0)
{
uassert_false(1);
}
@ -284,19 +284,19 @@ static void thread3_recv_dynamic_mb(void *arg)
rt_err_t result = RT_EOK;
result = rt_mb_recv(test_dynamic_mb, (rt_ubase_t *)&mb_recv_str1, RT_WAITING_FOREVER);
if (result != RT_EOK || strcmp(mb_recv_str1, mb_send_str1) != 0)
if (result != RT_EOK || rt_strcmp((const char *)mb_recv_str1, (const char *)mb_send_str1) != 0)
{
uassert_false(1);
}
result = rt_mb_recv(test_dynamic_mb, (rt_ubase_t *)&mb_recv_str2, RT_WAITING_FOREVER);
if (result != RT_EOK || strcmp(mb_recv_str2, mb_send_str2) != 0)
if (result != RT_EOK || rt_strcmp((const char *)mb_recv_str2, (const char *)mb_send_str2) != 0)
{
uassert_false(1);
}
result = rt_mb_recv(test_dynamic_mb, (rt_ubase_t *)&mb_recv_str3, RT_WAITING_FOREVER);
if (result != RT_EOK || strcmp(mb_recv_str3, mb_send_str3) != 0)
if (result != RT_EOK || rt_strcmp((const char *)mb_recv_str3, (const char *)mb_send_str3) != 0)
{
uassert_false(1);
}

View File

@ -269,7 +269,6 @@ static void test_static_semaphore_release_isr(void)
#ifdef RT_USING_HEAP
static void test_dynamic_semaphore_create(void)
{
rt_err_t result;
int rand_num = rand() % 0x10000;
for (int i = 0; i < rand_num; i++)

View File

@ -121,8 +121,8 @@ void rt_signal_wait_thread(void *parm)
rt_signal_install(SIGUSR1, sig_handle_default);
rt_signal_unmask(SIGUSR1);
sigemptyset(&selectset);
sigaddset(&selectset, SIGUSR1);
(void)sigemptyset(&selectset);
(void)sigaddset(&selectset, SIGUSR1);
/* case 5:rt_signal_wait, two thread, thread1: install and unmask, then wait 1s; thread2: kill, should received. */
if (rt_signal_wait(&selectset, &recive_si, RT_TICK_PER_SECOND) != RT_EOK)