Skip to content
Snippets Groups Projects
Commit e948d843 authored by Anton Grahn's avatar Anton Grahn
Browse files

bare0_2

parent b40da8c5
No related branches found
No related tags found
No related merge requests found
......@@ -26,8 +26,8 @@ extern crate panic_semihosting;
use cortex_m_rt::entry;
// a constant (cannot be changed at run-time)
const X_INIT: u32 = 10;
//const X_INIT: u32 = core::u32::MAX;
//const X_INIT: u32 = 10;
const X_INIT: u32 = core::u32::MAX;
// global mutable variables (changed using unsafe code)
static mut X: u32 = X_INIT;
......@@ -85,6 +85,8 @@ fn main() -> ! {
// (Hint, look under OUTPUT/Adopter Output to see the `openocd` output.)
//
// ** your answer here **
// First it says that the local x gets optimized out then it panics
// "panicked at 'attempt to add with overflow', examples/bare0.rs:42:9"
//
// Commit your answers (bare0_2)
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment