Skip to content

Commit

Permalink
fixup! cpu: Fix array-bounds errors with GCC 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Nohlgård committed Jul 12, 2016
1 parent c68a0b3 commit 7193a1c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions cpu/nrf51/periph/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,7 @@ int adc_sample(adc_t line, adc_res_t res)

return val;
}

#else
typedef int dont_be_pedantic;
#endif /* ADC_CONFIG */
6 changes: 3 additions & 3 deletions cpu/stm32_common/periph/dac.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#include "periph_conf.h"

/* only compile this, if the CPU has a DAC */
#if defined(DAC) || defined(DAC1)
#ifdef DAC_CONFIG
#if (defined(DAC) || defined(DAC1)) && defined(DAC_CONFIG)

#ifdef DAC2
#define _DAC(line) (dac_config[line].dac ? DAC2 : DAC1)
Expand Down Expand Up @@ -91,5 +90,6 @@ void dac_poweroff(dac_t line)
DAC->CR &= ~(1 << (16 * dac_config[line].chan));
}

#endif /* DAC_CONFIG */
#else
typedef int dont_be_pedantic;
#endif /* DAC */
2 changes: 2 additions & 0 deletions cpu/stm32f0/periph/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,6 @@ int adc_sample(adc_t line, adc_res_t res)
return sample;
}

#else
typedef int dont_be_pedantic;
#endif /* ADC_CONFIG */
2 changes: 2 additions & 0 deletions cpu/stm32f1/periph/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,6 @@ int adc_sample(adc_t line, adc_res_t res)
return sample;
}

#else
typedef int dont_be_pedantic;
#endif /* ADC_CONFIG */
2 changes: 2 additions & 0 deletions cpu/stm32f4/periph/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,6 @@ int adc_sample(adc_t line, adc_res_t res)
return sample;
}

#else
typedef int dont_be_pedantic;
#endif /* ADC_CONFIG */

0 comments on commit 7193a1c

Please sign in to comment.