Bug#308291: please prevent compiler warning about unused variable
On Tue, May 10, 2005 at 09:58:34PM -0400, Steve M. Robbins wrote: On Mon, May 09, 2005 at 09:59:43AM +0200, martin f krafft wrote: Some of us like to use -Werror. Some of boost does not. That's a little cryptic. ;-) no, it isn't :) I assume you're saying that some boost code generates a warning. What warning? a warning about unused variable, i suppose :) diff -u /tmp/interface_oarchive.hpp /usr/include/boost/archive/detail/interface_oarchive.hpp --- /tmp/interface_oarchive.hpp 2005-05-09 09:54:24.897652747 +0200 +++ /usr/include/boost/archive/detail/interface_oarchive.hpp 2005-05-09 09:54:56.611522300 +0200 @@ -57,7 +57,7 @@ } templateclass T -const basic_pointer_oserializer * register_type(T * t = NULL){ +const basic_pointer_oserializer * register_type(T * = NULL){ const basic_pointer_oserializer bpos = instantiate_pointer_oserializer( static_castArchive *(NULL), I don't understand how the patched code is legal C++. yes, it is. the parameter name is not part of the function signature. when you declare functions you can always omit the parameters name, when you define function you can omit only those you are not using. you can even specify different parameter names in function declaration and definition. The original code defines a templated function register_type that takes an optional parameter t of type T*. Is removing the parameter name really legal? definitely yes. cheers domenico -[ Domenico Andreoli, aka cavok --[ http://people.debian.org/~cavok/gpgkey.asc ---[ 3A0F 2F80 F79C 678A 8936 4FEE 0677 9033 A20E BC50 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#308291: please prevent compiler warning about unused variable
also sprach Steve M. Robbins [EMAIL PROTECTED] [2005.05.11.0358 +0200]: Some of us like to use -Werror. Some of boost does not. That's a little cryptic. ;-) I assume you're saying that some boost code generates a warning. What warning? unused variable t -const basic_pointer_oserializer * register_type(T * t = NULL){ +const basic_pointer_oserializer * register_type(T * = NULL){ I don't understand how the patched code is legal C++. The original code defines a templated function register_type that takes an optional parameter t of type T*. Is removing the parameter name really legal? It seems to work with g++ at least. I don't know if it's standard C++, but I think so. From what I understand, removing the parameter name just prevents a variable to be initialised to the parameter's value. An alternative would be a statement such as if (t); in the code. -- .''`. martin f. krafft [EMAIL PROTECTED] : :' :proud Debian developer, admin, user, and author `. `'` `- Debian - when you have better things to do than fixing a system Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver! your eyes are weary from staring at the CRT. you feel sleepy. notice how restful it is to watch the cursor blink. close your eyes. the opinions stated above are yours. you cannot imagine why you ever felt otherwise. signature.asc Description: Digital signature
Bug#308291: please prevent compiler warning about unused variable
On Mon, May 09, 2005 at 09:59:43AM +0200, martin f krafft wrote: Some of us like to use -Werror. Some of boost does not. That's a little cryptic. ;-) I assume you're saying that some boost code generates a warning. What warning? Please consider the following, non-intrusive and tested patches: diff -u /tmp/interface_oarchive.hpp /usr/include/boost/archive/detail/interface_oarchive.hpp --- /tmp/interface_oarchive.hpp 2005-05-09 09:54:24.897652747 +0200 +++ /usr/include/boost/archive/detail/interface_oarchive.hpp 2005-05-09 09:54:56.611522300 +0200 @@ -57,7 +57,7 @@ } templateclass T -const basic_pointer_oserializer * register_type(T * t = NULL){ +const basic_pointer_oserializer * register_type(T * = NULL){ const basic_pointer_oserializer bpos = instantiate_pointer_oserializer( static_castArchive *(NULL), I don't understand how the patched code is legal C++. The original code defines a templated function register_type that takes an optional parameter t of type T*. Is removing the parameter name really legal? -Steve -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#308291: please prevent compiler warning about unused variable
Package: libboost-dev Version: 1.32.0-6 Severity: minor Tags: upstream patch Some of us like to use -Werror. Some of boost does not. Please consider the following, non-intrusive and tested patches: diff -u /tmp/interface_oarchive.hpp /usr/include/boost/archive/detail/interface_oarchive.hpp --- /tmp/interface_oarchive.hpp 2005-05-09 09:54:24.897652747 +0200 +++ /usr/include/boost/archive/detail/interface_oarchive.hpp 2005-05-09 09:54:56.611522300 +0200 @@ -57,7 +57,7 @@ } templateclass T -const basic_pointer_oserializer * register_type(T * t = NULL){ +const basic_pointer_oserializer * register_type(T * = NULL){ const basic_pointer_oserializer bpos = instantiate_pointer_oserializer( static_castArchive *(NULL), diff -u /tmp/interface_iarchive.hpp /usr/include/boost/archive/detail/interface_iarchive.hpp --- /tmp/interface_iarchive.hpp 2005-05-09 09:58:24.366913089 +0200 +++ /usr/include/boost/archive/detail/interface_iarchive.hpp 2005-05-09 09:58:31.519755952 +0200 @@ -53,7 +53,7 @@ } templateclass T -const basic_pointer_iserializer * register_type(T * t = NULL){ +const basic_pointer_iserializer * register_type(T * = NULL){ const basic_pointer_iserializer bpis = archive::detail::instantiate_pointer_iserializer( static_castArchive *(NULL), -- System Information: Debian Release: 3.1 Architecture: amd64 (x86_64) Kernel: Linux 2.6.10-9-amd64-k8 Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Versions of packages libboost-dev depends on: ii libstdc++5-3.3-dev [libstdc++ 1:3.3.5-12 The GNU Standard C++ Library v3 (d -- no debconf information -- .''`. martin f. krafft [EMAIL PROTECTED] : :' :proud Debian developer, admin, user, and author `. `'` `- Debian - when you have better things to do than fixing a system Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver! who's general failure, and why's he reading my disk? signature.asc Description: Digital signature
Bug#308291: archive's i/o register_type() signature (Bug#308291: please prevent compiler warning about unused variable)
hi, boost debian package has been reported this bug/wish. is anybody able to commit this tiny fix? many thanks. cheers domenico - Forwarded message from martin f krafft [EMAIL PROTECTED] - Date: Mon, 9 May 2005 09:59:43 +0200 From: martin f krafft [EMAIL PROTECTED] Subject: Bug#308291: please prevent compiler warning about unused variable Some of us like to use -Werror. Some of boost does not. Please consider the following, non-intrusive and tested patches: diff -u /tmp/interface_oarchive.hpp /usr/include/boost/archive/detail/interface_oarchive.hpp --- /tmp/interface_oarchive.hpp 2005-05-09 09:54:24.897652747 +0200 +++ /usr/include/boost/archive/detail/interface_oarchive.hpp 2005-05-09 09:54:56.611522300 +0200 @@ -57,7 +57,7 @@ } templateclass T -const basic_pointer_oserializer * register_type(T * t = NULL){ +const basic_pointer_oserializer * register_type(T * = NULL){ const basic_pointer_oserializer bpos = instantiate_pointer_oserializer( static_castArchive *(NULL), diff -u /tmp/interface_iarchive.hpp /usr/include/boost/archive/detail/interface_iarchive.hpp --- /tmp/interface_iarchive.hpp 2005-05-09 09:58:24.366913089 +0200 +++ /usr/include/boost/archive/detail/interface_iarchive.hpp 2005-05-09 09:58:31.519755952 +0200 @@ -53,7 +53,7 @@ } templateclass T -const basic_pointer_iserializer * register_type(T * t = NULL){ +const basic_pointer_iserializer * register_type(T * = NULL){ const basic_pointer_iserializer bpis = archive::detail::instantiate_pointer_iserializer( static_castArchive *(NULL), - End forwarded message - -[ Domenico Andreoli, aka cavok --[ http://people.debian.org/~cavok/gpgkey.asc ---[ 3A0F 2F80 F79C 678A 8936 4FEE 0677 9033 A20E BC50 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]