changeset 2079:acb4cd4af771

Performance warning if runtime debug assertions are turned on
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 07 Sep 2016 09:03:37 +0200
parents 14ce887a9182
children bb93de4f4562
files OrthancServer/main.cpp
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/main.cpp	Wed Aug 31 17:35:38 2016 +0200
+++ b/OrthancServer/main.cpp	Wed Sep 07 09:03:37 2016 +0200
@@ -1086,6 +1086,14 @@
 }
 
 
+static bool DisplayPerformanceWarning()
+{
+  (void) DisplayPerformanceWarning;   // Disable warning about unused function
+  LOG(WARNING) << "Performance warning: Non-release build, runtime debug assertions are turned on";
+  return true;
+}
+
+
 int main(int argc, char* argv[]) 
 {
   Logging::Initialize();
@@ -1225,6 +1233,7 @@
     }
 
     LOG(WARNING) << "Orthanc version: " << version;
+    assert(DisplayPerformanceWarning());
   }
 
   int status = 0;