Skip to content

Commit

Permalink
Merge pull request #5727 from kaspar030/fix_panic_compile
Browse files Browse the repository at this point in the history
cpu: cortexm_common: fix compile warning
  • Loading branch information
Joakim Nohlgård authored Oct 14, 2016
2 parents bee918b + 3dfafde commit 11c11a5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cpu/cortexm_common/vectors_cortexm.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,11 @@ __attribute__((used)) void hard_fault_handler(uint32_t* sp, uint32_t corrupted,
uint32_t dfsr = SCB->DFSR;
uint32_t afsr = SCB->AFSR;
#endif
uint32_t pc;
uint32_t* orig_sp;

/* Initialize these variables even if they're never used uninitialized.
* Fixes wrong compiler warning by gcc < 6.0. */
uint32_t pc = 0;
uint32_t* orig_sp = NULL;

/* Check if the ISR stack overflowed previously. Not possible to detect
* after output may also have overflowed it. */
Expand Down

0 comments on commit 11c11a5

Please sign in to comment.