Merge pull request #3309 from tyustli/fix_init

[src] [components] fix compiler optimize bug
This commit is contained in:
Bernard Xiong 2020-01-03 12:47:18 +08:00 committed by GitHub
commit 87f14c54cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ void rt_components_board_init(void)
rt_kprintf(":%d done\n", result); rt_kprintf(":%d done\n", result);
} }
#else #else
const init_fn_t *fn_ptr; volatile const init_fn_t *fn_ptr;
for (fn_ptr = &__rt_init_rti_board_start; fn_ptr < &__rt_init_rti_board_end; fn_ptr++) for (fn_ptr = &__rt_init_rti_board_start; fn_ptr < &__rt_init_rti_board_end; fn_ptr++)
{ {
@ -118,7 +118,7 @@ void rt_components_init(void)
rt_kprintf(":%d done\n", result); rt_kprintf(":%d done\n", result);
} }
#else #else
const init_fn_t *fn_ptr; volatile const init_fn_t *fn_ptr;
for (fn_ptr = &__rt_init_rti_board_end; fn_ptr < &__rt_init_rti_end; fn_ptr ++) for (fn_ptr = &__rt_init_rti_board_end; fn_ptr < &__rt_init_rti_end; fn_ptr ++)
{ {