Hi Gustavo,

> Other (sometimes) errors are like that one. At files:
> 
> torture/unit/base/text/pdf-text-set-unicode.c, at fun
> test_one_string(...) -> Initialize variable input_data to NULL should
> do.
> torture/unit/base/text/pdf-text-set-from-unicode.c, at same function ->
> Same (seems the code was copied).
> 

Hum... no. Don't think that initializing to NULL is the fix there,
'input_data' is always initialized in the "Setup input data" if/elses.
The problem again seems that clang thinks that it can continue after a
fail_if() or fail_unless(), which is not true. We should try to
investigate why that happens... maybe we can make those check methods to
assert() when they fail, so that clang knows how to handle them.

> src/base/pdf-text.c at lines 1802/1804 ... well, that Clang thing
> doesn't seem to realize you can't continue if an assertion is false. I
> can't figure out how to correct that.
> 

I modified the code so that list iterators are used instead of
pdf_list_get_at(), and removed the assertions (which were to ensure that
in a list of N elements we can always get up to element N-1) in the
process. See:
http://bzr.savannah.gnu.org/lh/pdf/libgnupdf/trunk/revision/936

> lib/getopt.c line 852 - This one is disturbing to me. It shouldn't be
> possible because of the function's preconditions (longopt must be an
> array with a null name at the end), but in the code it appears to be
> that longopt can effectively be null (tested at line 476) and p=longopt
> is actually derreferenced in the loop control statement at line 852... I
> trust the gnulib better that me, but...
> 

Might be worth reporting that directly to gnulib.

> > > Is there a way to report this, so that future contributors don't need to
> > > spend time trying to figure it out again?
> > 
> > That is a good question. I've used other static analysis tools that
> > allow marking issues to be ignored through a web-based interface, but
> > it's not the case here, reports are static HTML. Maybe there's a way of
> > generating a file with things to ignore by clang? Something like
> > valgrind's suppressions file... would be good to check that.
> > 
> 
> I would check... if I knew how to :P
> 

Gave a quick look at the online manual and there seems to be no way of
doing that :-/

Cheers,

-- 
Aleksander

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to