Browse Source

Merge pull request #3309 from tyustli/fix_init

[src] [components] fix compiler optimize bug
Bernard Xiong 5 năm trước cách đây
mục cha
commit
87f14c54cb
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/components.c

+ 2 - 2
src/components.c

@@ -92,7 +92,7 @@ void rt_components_board_init(void)
         rt_kprintf(":%d done\n", result);
     }
 #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++)
     {
@@ -118,7 +118,7 @@ void rt_components_init(void)
         rt_kprintf(":%d done\n", result);
     }
 #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 ++)
     {