This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/24522] htonl in optimized template function generates compiler warning



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]