[Mesa-dev] [PATCH] configure.ac: enable non-gallium assertions for people not using --enable-debug

Marek Olšák maraeo at gmail.com
Sat Apr 11 15:02:57 PDT 2015


The problem is NDEBUG is defined if --enable-debug isn't used. If I
add -DDEBUG manually to CFLAGS, both DEBUG and NDEBUG will be defined.
That means Gallium assertions will be enabled (because DEBUG is
defined) and Mesa core assertion will be disabled (because NDEBUG is
defined).

I was about to suggest if we can stop using NDEBUG, but unfortunately
the standard "assert" uses it.

Marek


On Sat, Apr 11, 2015 at 9:57 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Sat, Apr 11, 2015 at 12:11 PM, Marek Olšák <maraeo at gmail.com> wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> ---
>>  configure.ac | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 4ed4b74..113fb49 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -421,7 +421,9 @@ if test "x$enable_debug" = xyes; then
>>          fi
>>      fi
>>  else
>> -   DEFINES="$DEFINES -DNDEBUG"
>> +   if [[ $DEFINES != *"-DDEBUG"* ]]; then
>> +      DEFINES="$DEFINES -DNDEBUG"
>> +   fi
>>  fi
>>
>>  dnl
>> --
>> 2.1.0
>
> I'm confused, but that might just be because we have DEBUG and NDEBUG
> (can we stop using DEBUG?).
>
> The subject basically says "enable assertions if not using
> --enable-debug"... to which I ask why?
>
> But that doesn't really seem to be an accurate description of the
> patch. The patch seems to be adding -DNDEBUG (which disables
> assertions) if we haven't added -DDEBUG to DEFINES.
>
> So yeah, confused.


More information about the mesa-dev mailing list