Ticket #1269 (closed defect: duplicate)

Opened 4 years ago

Last modified 4 years ago

Compile error in rev 1040, file src/rpc/xmlrpc.cc

Reported by: VesselinK Owned by: rakshasa
Priority: normal Component: libtorrent
Version: HEAD Severity: normal
Keywords: Cc:

Description

Method set_size_limitis is declared in src/rpc/xmlrpc.h as

static void set_size_limit(uint64_t size);

It is defined in src/rpc/xmlrpc.cc as:

XmlRpc::set_size_limit(int64_t size) {}

As a result I get the following compile error: g++ -DHAVE_CONFIG_H -I. -I../.. -I. -I./.. -I../.. -O2 -Wall -g -DDEBUG -I/usr/local/include/sigc++-2.0 -I/usr/local/lib/sigc++-2.0/include -I/usr/local/include -MT xmlrpc.o -MD -MP -MF .deps/xmlrpc.Tpo -c -o xmlrpc.o xmlrpc.cc xmlrpc.cc:540: prototype for `void rpc::XmlRpc::set_size_limit(long long int)'

does not match any in class `rpc::XmlRpc?'

xmlrpc.h:98: candidate is: static void rpc::XmlRpc::set_size_limit(long long

unsigned int)

make[3]: *** [xmlrpc.o] Error 1 make[3]: Leaving directory `/usr/src/rtorrent/src/rpc' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/src/rtorrent/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/rtorrent' make: *** [all] Error 2

I presume uint64_t is the correct type. The fix is trivial:

============================================= --- src/rpc/xmlrpc.cc (revision 1040) +++ src/rpc/xmlrpc.cc (working copy) @@ -537,7 +537,7 @@

bool XmlRpc::process(UNUSED const char* inBuffer, UNUSED uint32_t length, UNUSED slot_write slotWrite) { return false; }

int64_t XmlRpc::size_limit() { return 0; }

-void XmlRpc::set_size_limit(int64_t size) {} +void XmlRpc::set_size_limit(uint64_t size) {}

#endif

Attachments

rtorrent_patch Download (448 bytes) - added by VesselinK 4 years ago.

Change History

Changed 4 years ago by VesselinK

Changed 4 years ago by rakshasa

  • status changed from new to closed
  • resolution set to fixed

Changed 4 years ago by Blinkiz

  • status changed from closed to reopened
  • resolution fixed deleted

Having similar problem with rev 1041. Maybe it's the same bug?

niklas@fileserver:~/rtorrent$ make -s
Making all in doc
Making all in src
Making all in core
Making all in display
Making all in input
Making all in rpc
xmlrpc.cc: In function ‘rpc::target_type rpc::xmlrpc_to_target(xmlrpc_env*, xmlrpc_value*)’:
xmlrpc.cc:213: error: jump to case label
xmlrpc.cc:156: error:   crosses initialization of ‘core::Download* download’
xmlrpc.cc: In function ‘torrent::Object rpc::xmlrpc_to_object(xmlrpc_env*, xmlrpc_value*, int, rpc::target_type*)’:
xmlrpc.cc:284: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[3]: *** [xmlrpc.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
niklas@fileserver:~/rtorrent$

Changed 4 years ago by rakshasa

  • status changed from reopened to closed
  • resolution set to duplicate

Not the same bug.

Note: See TracTickets for help on using tickets.