[tools/regression] Borland patch for compiler_status.cpp

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[tools/regression] Borland patch for compiler_status.cpp

Nicola Musatti
Hallo,
the following patch makes it possible to compile compiler_status.cpp
with the Borland compilers. Apparently under some conditions the Borland
compiler issues an error for a valid use of the ternary operator. It is
sufficient to wrap the whole expression in parentheses to overcome the
problem. The same workaround is applied twice in the patch.

Cheers,
Nicola Musatti


Index: compiler_status.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/regression/compiler_status.cpp,v
retrieving revision 1.38
diff -d -b -u -r1.38 compiler_status.cpp
--- compiler_status.cpp 19 Jun 2005 21:08:17 -0000 1.38
+++ compiler_status.cpp 23 Jan 2006 23:06:22 -0000
@@ -400,13 +400,16 @@
                        bool always_show_run_output = false )
   {
     // compile msgs sometimes modified, so make a local copy
-    string compile( (pass && no_warn)
-      ? empty_string :  element_content( db, "compile" ) );
+    // extra parentheses needed to workaround a Borland bug
+    string compile( ( (pass && no_warn)
+      ? empty_string :  element_content( db, "compile" ) ) );
 
     const string & link( pass ? empty_string : element_content( db, "link" ) );
     const string & run( (pass && !always_show_run_output)
       ? empty_string : element_content( db, "run" ) );
-    string lib( pass ? empty_string : element_content( db, "lib" ) );
+
+    // extra parentheses needed to workaround a Borland bug
+    string lib( ( pass ? empty_string : element_content( db, "lib" ) ) );
 
     // some compilers output the filename even if there are no errors or
     // warnings; detect this if one line of output and it contains no space.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost