Bruno Haible via Gnulib discussion list <bug-gnulib@gnu.org> writes:

> Finally some good use of the GCC analyzer. gcc reports this warning:
>
> -Wanalyzer-possible-null-argument       
> ../../../gettext-tools/gnulib-lib/vc-mtime.c:374:7: warning: use of 
> possibly-NULL 'dir2' where non-null expected [CWE-690]

I find that gcc -fanalyzer works very well in Gnulib and some other GNU
projects since functions are marked with __attribute__'s when relevant.

> The cause is that xgetcwd() may return NULL, which I did not remember.

Good catch. I assumed from the name it would always be successful or
exit. But it only exits when OOM, not for other errors.

Collin

Reply via email to