This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24522] htonl in optimized template function generates compiler warning
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Oct 2005 16:36:49 -0000
- Subject: [Bug c++/24522] htonl in optimized template function generates compiler warning
- References: <bug-24522-11586@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from ian at airs dot com 2005-10-25 16:36 -------
I believe this winds up being a duplicate of PR c++/8057, which is fixed on
mainline. With the test case in the PR, I see the warning with 4.0, but I do
not see the warning on mainline.
Note that this slightly modified test case:
#include <netinet/in.h>
template<typename S>
void serialize(const uint32_t* pitem, const S& item) {
uint32_t t2 = htonl(item);
}
template void serialize<int> (const uint32_t*, const int&);
issues a warning on both 4.0 and mainline:
foo.cc: In function ?void serialize(const uint32_t*, const S&) [with S = int]?:
foo.cc:8: instantiated from here
foo.cc:5: warning: unused variable ?t2?
--
ian at airs dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ian at airs dot com
Known to work| |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24522