]> AND Private Git Repository - loba.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Use static instead of volatile for variables that may be clobbered by a TRY..CATCH.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 3 Nov 2011 13:20:32 +0000 (14:20 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 3 Nov 2011 13:21:24 +0000 (14:21 +0100)
main.cpp

index 8dbbc796034b19502cea025228a097cefc0c5349..011b25829306cca025a1f482c66e56291f2f94fa 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -194,9 +194,10 @@ static void install_signal_handler()
 
 int main(int argc, char* argv[])
 {
 
 int main(int argc, char* argv[])
 {
-    // Note: variables used after THROW must be declared as volatile.
-    volatile int exit_status = 0;   // global exit status
-    volatile double simulated_time = -1.0;
+    // Note: variables modified between TRY (setjmp) and THROW (longjmp)
+    // must be declared as static or volatile.
+    static int exit_status = 0;   // global exit status
+    static double simulated_time = -1.0;
     timestamp elapsed_time(timestamp::wallclock_time);
     timestamp simulation_time(timestamp::cpu_time);
     xbt_ex_t ex;
     timestamp elapsed_time(timestamp::wallclock_time);
     timestamp simulation_time(timestamp::cpu_time);
     xbt_ex_t ex;