From 8d9e22df8afa4c3339e52c7b3b77388ca0e69fac Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Fri, 28 Mar 2014 13:53:30 +0100 Subject: Make article 6 compile ; modifications to article 1 && 2 for the course. --- sos-code-article2/sos/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sos-code-article2/sos') diff --git a/sos-code-article2/sos/main.c b/sos-code-article2/sos/main.c index 9d897b0..1f91c22 100644 --- a/sos-code-article2/sos/main.c +++ b/sos-code-article2/sos/main.c @@ -133,12 +133,12 @@ void sos_main(unsigned long magic, unsigned long addr) compiling with -O3: "i=1/0;" is considered dead code with gcc -O3. */ i = 10; - while (1) - { /* Stupid function call to fool gcc optimizations */ sos_bochs_printf("i = 1 / %d...\n", i); i = 1 / i; - } + sos_bochs_printf("i = 1 / %d...\n", i); + i = 1 / i; + sos_bochs_printf("i = 1 / %d...\n", i); /* Will never print this since the "divide by zero" exception always returns to the faulting instruction (see Intel x86 doc vol 3, -- cgit v1.2.3