Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-g.b-one.net (mx-g.one.com [91.198.169.54])
	by mail9.b-one.net (Postfix) with ESMTP id 00952400125
	for <info@awaresystems.be>; Thu,  5 Feb 2009 19:55:35 +0100 (CET)
X-Virus-Scanned: by one.com
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=6 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-g.b-one.net (Postfix) with ESMTP id 45CF414000AF
	for <info@awaresystems.be>; Thu,  5 Feb 2009 19:55:35 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 6796B1D18E112;
	Thu,  5 Feb 2009 13:52:59 -0500 (EST)
Received: from sasl.smtp.pobox.com (a-sasl-fastnet.sasl.smtp.pobox.com
	[207.106.133.19])
	by lists.maptools.org (Postfix) with ESMTP id F25DA1D18EA60
	for <tiff@lists.maptools.org>; Thu,  5 Feb 2009 13:38:41 -0500 (EST)
Received: from localhost.localdomain (unknown [127.0.0.1])
	by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id
	9E0EF97FB6
	for <tiff@lists.maptools.org>; Thu,  5 Feb 2009 13:38:40 -0500 (EST)
Received: from [192.168.2.4] (unknown [67.47.28.121]) (using TLSv1 with
	cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate
	requested)
	by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id
	EB2C797FB5
	for <tiff@lists.maptools.org>; Thu,  5 Feb 2009 13:38:36 -0500 (EST)
Message-ID: <498B321F.3000300@pobox.com>
Date: Thu, 05 Feb 2009 13:38:23 -0500
From: Frank Warmerdam <warmerdam@pobox.com>
User-Agent: Thunderbird 2.0.0.6 (X11/20071022)
MIME-Version: 1.0
To: TIFF mailing list <tiff@lists.maptools.org>
X-Pobox-Relay-ID: 35618EBC-F3B4-11DD-9C55-8B21C92D7133-06493634!a-sasl-fastnet.pobox.com
Subject: [Tiff] assertions, and building with DEBUG/NDEBUG
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

Folks,

Tavis Ormandy has reported some problems with corrupt tiff files that
trigger assertions() in libtiff.

   http://bugzilla.maptools.org/show_bug.cgi?id=1995

It appears these assertions are being used to call to attention problems
in these files for developers, and are intended to be compiled out in
production software.

On investigation I see that NDEBUG needs to be defined to disable assertions.
Previously I had assumed that it was sufficient to not define DEBUG but that
does not appear to be the case.

So my question is, is it normal for people building for production purposes
to build with NDEBUG defined?

I found I had to set CFLAGS=-DNDEBUG before configuring to disable asserts.
I also notice that the windows makefiles make no mention of DEBUG or NDEBUG.

I am contemplating modifying tiffiop.h to explicitly define NDEBUG if
DEBUG is not defined, before including assert.h.  This would mean that
assertions are compiled out by default, and only included if DEBUG is
explicitly requested.  I would also change Makefile.vc to define DEBUG for
the debug build case.

Does anyone have thoughts on a more appropriate approach?

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
