[sldev] [HELP] Compiling Snowglobe

Sharven Raabe sharven.raabe at googlemail.com
Sun Jul 26 07:28:20 PDT 2009


Hello,

I haven't tried to compile my own viewer for a while now, since the
normal ones work fine recently. Since I am curious I wanted to compile
the viewer again, under Ubunty Jaunty, 64bit. I've not done much in
C++ for a while either, so I hope my questions are not too stupid.

I've checked the source right out of Snowglobe's trunk, Revision 2562.
If anyone could suggest a revision that makes less problems but is
still pretty recent, to have something to work on, I'd be happy for
it. I had to make some modifications in indra/test/test.cpp already,
but that was only minor stuff. However the compiling fails at a
std::memset() call in llmessage.

But the call looks perfectly alright to me. And size depends on the
whatever is in mvci which again depends on what is within in that
message variabele iterator... So how can the compiler claim that this
might that size was const zero? The call is alright, the parameters
have not been transposed.

----
Error Message:
In function 'void* memset(void*, int, size_t)',
    inlined from 'BOOL LLTemplateMessageReader::decodeData(const U8*,
const LLHost&)' at
/home/sharven/local/src/Snowglobe/indra/llmessage/lltemplatemessagereader.cpp:680:
/usr/include/bits/string3.h:82: error: call to
'__warn_memset_zero_len' declared with attribute warning: memset used
with constant zero length parameter; this could be due to transposed
parameters

----
Code:
for (LLMessageBlock::message_variable_map_t::const_iterator iter =
		  mbci->mMemberVariables.begin();
	  iter != mbci->mMemberVariables.end(); iter++)
{
const LLMessageVariable& mvci = **iter;

(...)

The call looks like this:
// default to 0s.
U32 size = mvci.getSize();
std::vector<U8> data(size);
memset(&(data[0]), 0, size);

(...)
}
----
Manpage:
$ man memset
SYNOPSIS
#include <string.h>

void *memset(void *s, int c, size_t n);

DESCRIPTION
 The memset() function fills the first n bytes of the memory area
pointed to by s with the constant byte c.
----


More information about the SLDev mailing list