Re: Dereference of undefined pointer value in conftest.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Tomas,

* Tomas Carnecky wrote on Sun, Dec 06, 2009 at 09:10:47PM CET:
> I just ran the clang static analyzer on the xserver configure script and
> it reported a few issues. Most of them were dead assignments/increments,
> but there also was one dereference of an undefined pointer value. I
> don't know which tests the conftest.c belongs to, but I doubt it's to
> test if an application can safely write to unknown memory ;). The test
> contains the following code:

The code is from AC_C_CONST.  If your package requires anything near a
C89 (or newer) compiler, then you don't need and shouldn't use
AC_C_CONST.  Compilers not grokking 'const' are old (I don't know how
old, but I've never met one).

Last time we looked at this code because someone reported oddities, we
concluded that we shouldn't change the test because we had no way of
verifying whether the test would still expose the documented issue
afterwards.  In general, you are of course right that tests shouldn't
have undefined behavior, but sometimes that is unavoidable.

Cheers,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux