Boost logo

Boost :

From: Nicola Musatti (Nicola.Musatti_at_[hidden])
Date: 2006-02-28 17:23:30


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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk