Boost logo

Boost-Build :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-09-18 09:38:16


Reece Dunn wrote:
> I have attached a patch to add warning support. At the moment there is
> only support for the msvc, borland and cw toolsets.

This is a slightly revised version of the patch to remove the explicit
-w flag being added in the Borland C/C++ action. I am happy with this
patch now.

- Reece
 --------------000006080805030206070802 Content-Type: text/plain;
name="warnings.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="warnings.diff"

? msvc64.diff
Index: borland.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/borland.jam,v
retrieving revision 1.17
diff -u -r1.17 borland.jam
--- borland.jam 16 Jun 2005 09:38:45 -0000 1.17
+++ borland.jam 17 Sep 2005 19:39:04 -0000
@@ -67,6 +67,11 @@
flags borland CFLAGS <inlining>on : -vi -w-inl ;
flags borland CFLAGS <inlining>full : -vi -w-inl ;

+flags borland.compile OPTIONS <warnings>on : ;
+flags borland.compile OPTIONS <warnings>off : -w- ;
+flags borland.compile OPTIONS <warnings>all : -w ;
+flags borland.compile OPTIONS <warnings-as-errors>on : -w! ;
+

# Deal with various runtime configs...

@@ -99,7 +104,6 @@
# -q no banner
# -c compile to object
# -P C++ code regardless of file extention
-# -w turns on all warnings
# -Ve zero sized empty base classes, this option is on in the IDE by default
# and effects binary compatibility.
# -Vx zero sized empty members, this option is on in the IDE by default
@@ -113,13 +117,13 @@

actions compile.c++
{
- "$(CONFIG_COMMAND)" -j5 -g255 -q -c -P -w -Ve -Vx -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
+ "$(CONFIG_COMMAND)" -j5 -g255 -q -c -P -Ve -Vx -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
}

# For C, we don't pass -P flag
actions compile.c
{
- "$(CONFIG_COMMAND)" -j5 -g255 -q -c -w -Ve -Vx -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
+ "$(CONFIG_COMMAND)" -j5 -g255 -q -c -Ve -Vx -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
}

Index: builtin.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/builtin.jam,v
retrieving revision 1.178
diff -u -r1.178 builtin.jam
--- builtin.jam 14 Sep 2005 09:54:14 -0000 1.178
+++ builtin.jam 17 Sep 2005 19:39:04 -0000
@@ -79,6 +79,17 @@
feature dependency : : free dependency incidental ;
feature implicit-dependency : : free dependency incidental ;

+feature warnings :
+ on # turn warnings on
+ off # turn warnings off
+ all # enable all warnings
+ : incidental ;
+
+feature warnings-as-errors :
+ off # do not fail the compilation if there are warnings
+ on # fail the compilation if there are warnings
+ : incidental ;
+
feature source : : free dependency incidental ;
feature library : : free dependency incidental ;
feature file : : free dependency incidental ;
Index: cw.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/cw.jam,v
retrieving revision 1.5
diff -u -r1.5 cw.jam
--- cw.jam 28 Jun 2005 09:35:45 -0000 1.5
+++ cw.jam 17 Sep 2005 19:39:04 -0000
@@ -133,6 +133,11 @@
flags cw.compile CFLAGS <exception-handling>off : -Cpp_exceptions off ;
flags cw.compile CFLAGS <rtti>off : -RTTI off ;

+flags cw.compile CFLAGS <warnings>on : -w on ;
+flags cw.compile CFLAGS <warnings>off : -w off ;
+flags cw.compile CFLAGS <warnings>all : -w all ;
+flags cw.compile CFLAGS <warnings-as-errors>on : -w error ;
+
flags cw.compile USER_CFLAGS <cflags> : ;
flags cw.compile.c++ USER_CFLAGS <cxxflags> : ;

Index: gcc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/gcc.jam,v
retrieving revision 1.55
diff -u -r1.55 gcc.jam
--- gcc.jam 1 Sep 2005 08:04:48 -0000 1.55
+++ gcc.jam 17 Sep 2005 19:39:05 -0000
@@ -78,6 +78,11 @@
flags gcc.compile OPTIONS <inlining>on : -Wno-inline ;
flags gcc.compile OPTIONS <inlining>full : -finline-functions -Wno-inline ;

+flags gcc.compile CFLAGS <warnings>on : ;
+flags gcc.compile CFLAGS <warnings>off : -w ;
+flags gcc.compile CFLAGS <warnings>all : -Wall ;
+flags gcc.compile CFLAGS <warnings-as-errors>on : -Werror ;
+
flags gcc.compile OPTIONS <debug-symbols>on : -g ;
flags gcc.compile OPTIONS <profiling>on : -pg ;
# On cygwin and mingw, gcc generates position independent code by default,
Index: msvc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/msvc.jam,v
retrieving revision 1.50
diff -u -r1.50 msvc.jam
--- msvc.jam 2 Sep 2005 07:35:54 -0000 1.50
+++ msvc.jam 17 Sep 2005 19:39:05 -0000
@@ -268,6 +268,11 @@
flags msvc.compile CFLAGS <inlining>on : /Ob1 ;
flags msvc.compile CFLAGS <inlining>full : /Ob2 ;

+flags msvc.compile CFLAGS <warnings>on : /W3 ;
+flags msvc.compile CFLAGS <warnings>off : /W0 ;
+flags msvc.compile CFLAGS <warnings>all : /W4 /Wp64 ;
+flags msvc.compile CFLAGS <warnings-as-errors>on : /WX ;
+
flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>off : /EHs ;
flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>on : /EHsc ;
flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>on/<extern-c-nothrow>off : /EHa ;
 --------------000006080805030206070802--


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk