[Xapian-discuss] Revision 13824 compilation failure

Olly Betts olly at survex.com
Thu Jan 14 13:15:56 GMT 2010


On Thu, Jan 14, 2010 at 02:54:56PM +0200, henka at cityweb.co.za wrote:
> ./common/pack.h: In member function ‘virtual std::string
> BrassDatabaseReplicator::apply_changeset_from_conn(RemoteConnection&,
> const OmTime&, bool) const’:
> ./common/pack.h:332: warning: ‘len’ may be used uninitialized in this
> function
> 
> I seem to recall 'len' not being init'd in other areas as well.
> 
> In fact, on all the machines where I compile xapian, uninitialized
> warnings are the only messages I've seen; nothing more serious.  I figured
> you already knew about these (since they stop compilation), so didn't
> bother reporting them.

GCC's uninitialised warnings are annoying - how smart they are about
gated uses, etc depend on what the compiler's optimisers do with the code,
which can vary as the code changes, but also between compiler versions
(and perhaps architectures, though I'm not sure about that).

In this case, there's no path where len can actually be used uninitialised.
We don't want to initialise it just to silence this warning, as this is
code which gets called a lot from hot loops.

I don't see these warnings on the machines I develop on though.

What does g++ --version report?  What platform is this on?

> btw, is there anything missing for http://trac.xapian.org/ticket/422?

Mostly my time to handle it right now, though it would be a bit less work to
apply if I didn't have to dig the doc change from another patch.  Don't worry
about that too much now, but try to bear it in mind for future patches.

Cheers,
    Olly



More information about the Xapian-discuss mailing list