patch to kill warnings on boost-cvs

Hi, here's a patch to shut up the gcc-3.4.1 compiler with all warnings enable (-Wextra -Wall). That'll be nice if this was put in the main package. My projects usually have -Werror and those ones below doesn't help. It's all about harmless unused function parameters. I must point that I didn't check other libraries, just the ones I usually use. Thanks, rod diff -ur boost/date_time/date_names_put.hpp /usr/include/boost-1_32/boost/date_time/date_names_put.hpp --- boost/date_time/date_names_put.hpp 2004-07-17 19:20:18.000000000 -0300 +++ /usr/include/boost-1_32/boost/date_time/date_names_put.hpp 2004-08-23 17:35:05.000000000 -0300 @@ -142,10 +142,10 @@ default: {} //quiet compilers that want all cases covered here (eg: gcc 3.1) } } - virtual void do_put_weekday_short(iter_type& oitr, weekday_enum wd) const + virtual void do_put_weekday_short(iter_type&, weekday_enum) const { } - virtual void do_put_weekday_long(iter_type& oitr, weekday_enum wd) const + virtual void do_put_weekday_long(iter_type&, weekday_enum) const { } virtual bool do_has_date_sep_chars() const diff -ur boost/date_time/gregorian/greg_month.hpp /usr/include/boost-1_32/boost/date_time/gregorian/greg_month.hpp --- boost/date_time/gregorian/greg_month.hpp 2004-07-18 15:36:16.000000000 -0300 +++ /usr/include/boost-1_32/boost/date_time/gregorian/greg_month.hpp 2004-08-23 16:29:25.000000000 -0300 @@ -78,20 +78,20 @@ /* parameterized as_*_string functions are intended to be called * from a template function: "... as_short_string(charT c='\0');" */ - const char* as_short_string(char c) const + const char* as_short_string(char) const { return as_short_string(); } - const char* as_long_string(char c) const + const char* as_long_string(char) const { return as_long_string(); } #ifndef BOOST_NO_STD_WSTRING - const wchar_t* as_short_string(wchar_t c) const + const wchar_t* as_short_string(wchar_t) const { return as_short_wstring(); } - const wchar_t* as_long_string(wchar_t c) const + const wchar_t* as_long_string(wchar_t) const { return as_long_wstring(); } diff -ur boost/token_functions.hpp /usr/include/boost-1_32/boost/token_functions.hpp --- boost/token_functions.hpp 2004-08-19 12:23:46.000000000 -0300 +++ /usr/include/boost-1_32/boost/token_functions.hpp 2004-08-23 16:34:48.000000000 -0300 @@ -212,7 +212,7 @@ } template<class Token, class Value> - static void plus_equal(Token &t, const Value &v) { + static void plus_equal(Token &, const Value &) { } @@ -220,7 +220,7 @@ // the clear. // template<class Token> - static void clear(Token &t) { + static void clear(Token &) { } };

Sorry, I forgot to mention that the cvs tarball I'm using is boost-04-08-23-1000.tar.bz2. []'s rod

Rodolfo Schulz de Lima wrote:
diff -ur boost/date_time/date_names_put.hpp /usr/include/boost-1_32/boost/date_time/date_names_put.hpp --- boost/date_time/date_names_put.hpp 2004-07-17 19:20:18.000000000 -0300 +++ /usr/include/boost-1_32/boost/date_time/date_names_put.hpp 2004-08-23 17:35:05.000000000 -0300 @@ -142,10 +142,10 @@ default: {} //quiet compilers that want all cases covered here (eg: gcc 3.1) } } - virtual void do_put_weekday_short(iter_type& oitr, weekday_enum wd) const + virtual void do_put_weekday_short(iter_type&, weekday_enum) const { } - virtual void do_put_weekday_long(iter_type& oitr, weekday_enum wd) const + virtual void do_put_weekday_long(iter_type&, weekday_enum) const { } virtual bool do_has_date_sep_chars() const
Aren't there compiler that require the variable name? I could have sworn we have a macro for this, BOOST_UNUSED_ARGUMENT() or something like this. But I can't find it right now... Markus

Hi Markus. "Markus Schöpflin" <markus.schoepflin@comsoft.de> wrote in message news:cgmnaf$8pe$1@sea.gmane.org...
Aren't there compiler that require the variable name? I could have sworn we have a macro for this, BOOST_UNUSED_ARGUMENT() or something like this. But I can't find it right now...
I believe there is something similar in 'concept_check.hpp'. It is an inline do-nothing template function called 'ignore_unused_variable_warning()'. Btw, is there any reason why this can not be moved somewhere more general utility header? Regards, Jurko

Markus Schöpflin <markus.schoepflin@comsoft.de> writes:
Rodolfo Schulz de Lima wrote:
diff -ur boost/date_time/date_names_put.hpp /usr/include/boost-1_32/boost/date_time/date_names_put.hpp --- boost/date_time/date_names_put.hpp 2004-07-17 19:20:18.000000000 -0300 +++ /usr/include/boost-1_32/boost/date_time/date_names_put.hpp 2004-08-23 17:35:05.000000000 -0300 @@ -142,10 +142,10 @@ default: {} //quiet compilers that want all cases covered here (eg: gcc 3.1) } } - virtual void do_put_weekday_short(iter_type& oitr, weekday_enum wd) const + virtual void do_put_weekday_short(iter_type&, weekday_enum) const { } - virtual void do_put_weekday_long(iter_type& oitr, weekday_enum wd) const + virtual void do_put_weekday_long(iter_type&, weekday_enum) const { } virtual bool do_has_date_sep_chars() const
Aren't there compiler that require the variable name?
No, I don't think so. It's not like this is a new C++ feature -- you can do it in 'C'. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

On Thu, 26 Aug 2004 20:38:01 -0300, Rodolfo Schulz de Lima wrote
Hi, here's a patch to shut up the gcc-3.4.1 compiler with all warnings enable (-Wextra -Wall). That'll be nice if this was put in the main package. My projects usually have -Werror and those ones below doesn't help. It's all about harmless unused function parameters.
Fixes applied to CVS. Thanks for the report. Jeff
participants (5)
-
David Abrahams
-
Jeff Garland
-
Jurko Gospodnetic
-
Markus Schöpflin
-
Rodolfo Schulz de Lima