[Top][All Lists]

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

Re: Dereference of undefined pointer value in conftest.c

From: Ralf Wildenhues
Subject: Re: Dereference of undefined pointer value in conftest.c
Date: Mon, 7 Dec 2009 07:36:49 +0100
User-agent: Mutt/1.5.20 (2009-10-28)

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]