On Mon, Apr 5, 2010 at 12:58 PM, Didier Barvaux <didier@...> wrote:
> Hi everybody,
> > While building libetpan as dependency for Claws Mail on my Gentoo
> > system, I caught some compiler warnings.
> > So I wrote some patches to fix several minor issues: unused variables,
> > functions or labels, warnings about NULL arguments where non-NULL is
> > expected, etc.
> Thanks to GNU libc 2.10 that appends __attribute__((nonnull(x))) to many
> system functions, GCC is able to report that one gives a possible NULL
> value to a function that expected only non-NULL values.
> Such a case happens with the atoi() function in the source file
> src/low-level/nntp/newsnntp.c. The macro clist_content() may return
> NULL but the atoi() function does not accept NULL values as argument.
> To fix the problem, the attached patch checks the return value of
> clist_begin() or clist_next() against NULL before calling
> clist_content() and then replaces the calls to clist_content() by calls
> to clist_content_nocheck() that does the same job but without the NULL
> Doing so adds a new macro but also avoids several NULL checks that were
> performed twice: once after clist_begin() or clist_next() and once in
I applied all the fixed, except this one since I'm not quite happy yet with
adding a function to remove a warning.
Can we disable that warning specifically in this part of the code ?
DINH Viêt Hoà