]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
In optimized mode, newer gccs can optimize the burn() function away entirely
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 4 Feb 2004 16:12:25 +0000 (16:12 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 4 Feb 2004 16:12:25 +0000 (16:12 +0000)
if the variable s is a local one. Make it global.

git-svn-id: https://svn.dealii.org/trunk@8394 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/timer.cc

index 7c957b03468995f8f47eb2aa30dc6922576e57f9..5a23e3e3f825639879fe5bfaaa22e0e639a86403 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -37,9 +37,9 @@ void compare (double t1, double t2, double ratio)
 
 // burn computer time
 
+double s = 0.;
 void burn (unsigned int n)
 {
-  double s = 0.;
   for (unsigned int i=0 ; i<n ; ++i)
     {
       for (unsigned int j=1 ; j<100000 ; ++j)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.