[sigc] [PATCH] Fix for warnings when -W -Wall is used
- From: Andris Pavenis <pavenis latnet lv>
- To: libsigc-list gnome org
- Subject: [sigc] [PATCH] Fix for warnings when -W -Wall is used
- Date: Mon, 13 Jun 2005 09:44:30 +0300
Use of GCC command line options '-W -Wall' causes warnings from
libsigc++ header files about unused parameters (for
operator()) in several places when recent GCC versions
like gcc-4.0.0 is being used.
This is a small nuisance in one uses -W -Wall -Werror to get rid
of warnings.
Included patch (against libsigc++-2.0.13) fixes this problem (at least
all such warnings, which I have encountered).
Andris
2005-06-11 Andris Pavenis <pavenis latnet lv>
*sigc++/adaptors/lambda/macros/base.h.m4:
*sigc++/adaptors/lambda/macros/select.h.m4
* sigc++/adaptors/macros/hide.h.m4: Specify only a type (not a
parameter name) for unused member function parameters
diff -ur3 libsigc++-2.0.13.orig/sigc++/adaptors/lambda/macros/base.h.m4 libsigc++-2.0.13/sigc++/adaptors/lambda/macros/base.h.m4
--- libsigc++-2.0.13.orig/sigc++/adaptors/lambda/macros/base.h.m4 2005-05-10 13:39:56.000000000 +0000
+++ libsigc++-2.0.13/sigc++/adaptors/lambda/macros/base.h.m4 2005-06-11 15:45:32.000000000 +0000
@@ -37,12 +37,12 @@
])dnl
define([LAMBDA_DO_VALUE],[dnl
template <LOOP(class T_arg%1, $1)>
- result_type operator ()(LOOP(T_arg%1 _A_%1, $1)) const
+ result_type operator ()(LOOP(T_arg%1, $1)) const
{ return value_; }
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
template <LOOP(class T_arg%1, $1)>
- result_type sun_forte_workaround(LOOP(T_arg%1 _A_%1, $1)) const
+ result_type sun_forte_workaround(LOOP(T_arg%1, $1)) const
{ return value_; }
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
diff -ur3 libsigc++-2.0.13.orig/sigc++/adaptors/lambda/macros/select.h.m4 libsigc++-2.0.13/sigc++/adaptors/lambda/macros/select.h.m4
--- libsigc++-2.0.13.orig/sigc++/adaptors/lambda/macros/select.h.m4 2004-08-03 17:58:20.000000000 +0000
+++ libsigc++-2.0.13/sigc++/adaptors/lambda/macros/select.h.m4 2005-06-11 15:45:32.000000000 +0000
@@ -21,12 +21,13 @@
dnl Macros to make select arguments
define([LAMBDA_SELECT_DO],[dnl
template <LOOP(class T_arg%1, $2)>
- T_arg$1 operator ()(LOOP(T_arg%1 _A_%1, $2)) const { return _A_$1; }
+dnl T_arg$1 operator ()(LOOP(T_arg%1 _A_%1, $2)) const { return _A_$1; }
+ T_arg$1 operator ()(LIST(FOR(1,eval($1-1),[T_arg%1,]),T_arg$1 _A_$1,FOR(eval($1+1),$2,[T_arg%1,]))) const { return _A_$1; }
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
template <LOOP(class T_arg%1, $2)>
//Does not work: T_arg$1 sun_forte_workaround(LOOP(T_arg%1 _A_%1, $2)) const { return operator()( LOOP(_A_%1, $2) ); }
- T_arg$1 sun_forte_workaround(LOOP(T_arg%1 _A_%1, $2)) const { return _A_$1; }
+ T_arg$1 sun_forte_workaround(LIST(FOR(1,eval($1-1),[T_arg%1,]),T_arg$1 _A_$1,FOR(eval($1+1),$2,[T_arg%1,]))) const { return _A_$1; }
#endif
])
diff -ur3 libsigc++-2.0.13.orig/sigc++/adaptors/macros/hide.h.m4 libsigc++-2.0.13/sigc++/adaptors/macros/hide.h.m4
--- libsigc++-2.0.13.orig/sigc++/adaptors/macros/hide.h.m4 2005-02-01 11:02:20.000000000 +0000
+++ libsigc++-2.0.13/sigc++/adaptors/macros/hide.h.m4 2005-06-11 15:45:32.000000000 +0000
@@ -36,7 +36,7 @@
*/
template <class T_arg1>
typename deduce_result_type<T_arg1>::type
- operator()(T_arg1 _A_a1)
+ operator()(T_arg1)
{ return this->functor_(); }
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
@@ -55,14 +55,14 @@
*/
template <LOOP([class T_arg%1], $2)>
typename deduce_result_type<LOOP(T_arg%1, $2)>::type
- operator()(LOOP(T_arg%1 _A_a%1, $2))
+ operator()(LOOP(T_arg%1 _A_a%1, eval($2-1)), T_arg$2)
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($2-1),[_P_(T_arg%1),]))>
(LIST(FOR(1,eval($2-1),[_A_a%1,]))); }
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
template <LOOP([class T_arg%1], $2)>
typename deduce_result_type<LOOP(T_arg%1, $2)>::type
- sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $2))
+ sun_forte_workaround(LOOP(T_arg%1 _A_a%1, eval($2-1)), T_arg$2)
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($2-1),[_P_(T_arg%1),]))>
(LIST(FOR(1,eval($2-1),[_A_a%1,]))); }
#endif
@@ -78,14 +78,14 @@
*/
template <LOOP([class T_arg%1], $2)>
typename deduce_result_type<LOOP(T_arg%1, $2)>::type
- operator()(LOOP(T_arg%1 _A_a%1, $2))
+ operator()(LIST(FOR(1,eval($1-1),[T_arg%1 _A_a%1,]),T_arg$1,FOR(eval($1+1),$2,[T_arg%1 _A_a%1,])))
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($1-1),[_P_(T_arg%1),]),FOR(eval($1+1), $2,[_P_(T_arg%1),]))>
(LIST(FOR(1,eval($1-1),[_A_a%1,]),FOR(eval($1+1),$2,[_A_a%1,]))); }
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
template <LOOP([class T_arg%1], $2)>
typename deduce_result_type<LOOP(T_arg%1, $2)>::type
- sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $2))
+ sun_forte_workaround(LIST(FOR(1,eval($1-1),[T_arg%1 _A_a%1,]),T_arg$1,FOR(eval($1+1),$2,[T_arg%1 _A_a%1,]))
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($1-1),[_P_(T_arg%1),]),FOR(eval($1+1), $2,[_P_(T_arg%1),]))>
(LIST(FOR(1,eval($1-1),[_A_a%1,]),FOR(eval($1+1),$2,[_A_a%1,]))); }
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]