From: DINH V. H. <din...@gm...> - 2010-04-05 17:48:29
|
I integrated this fix. I'll leave the warning. Thanks. On Mon, Apr 5, 2010 at 5:34 PM, Didier Barvaux <di...@ba...> wrote: > Hi Hoà, > > I updated my CVS checkout and resolved the different conflicts it > generated. I found one place were a part of a patch was mis-applied. > > The check on the return value of write() is done but the return value is > not stored the variable first :( > > The attached patch fixes that minor problem. > > Regards, > Didier Barvaux > > > > > > 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 check. > > > > > > > > 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 clist_content(). > > > > > > 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 ? > > > > Thank for your responsiveness. > > > > You may disable the warnings about NULL given as argument while > > non-NULL expected with the -Wno-nonnull option of GCC (see the > > description of the -Wnonnull option on > > http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html). > > > > However, other compiler may not accept this option. So, the "best" > > option is perhaps to let GCC emit the warnings. > > > > Regards, > > Didier Barvaux > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > libetpan-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libetpan-devel > > -- DINH Viêt Hoà |