Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx9.public.one.com ([195.47.247.105])
	by mail6.local.one.com (Dovecot) with LMTP id DD+gAXJPzFhuZAEAsyOMew
	for <filtered@awaresystems.be>; Fri, 17 Mar 2017 21:09:49 +0000
X-HalOne-ID: 0c58c56f-0b56-11e7-857c-246e961730ec
Received: from mail-ot0-f180.google.com (unknown [74.125.82.180])
	by mx9.public.one.com (Halon) with ESMTPS
	id 0c58c56f-0b56-11e7-857c-246e961730ec;
	Fri, 17 Mar 2017 21:09:46 +0000 (UTC)
Received: by mail-ot0-f180.google.com with SMTP id a12so34219969ota.0
        for <filtered@awaresystems.be>; Fri, 17 Mar 2017 14:09:46 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-original-authentication-results:x-gm-message-state:delivered-to
         :date:from:to:in-reply-to:message-id:references:user-agent
         :mime-version:cc:subject:precedence:list-id:list-unsubscribe
         :list-archive:list-post:list-help:list-subscribe
         :content-transfer-encoding:sender:errors-to;
        bh=jVn9f3XAyP8Qh8FBA2wyyQO2fXFHZ6/UIe3QowzXwqY=;
        b=ivM4kRkrFqVpTyoM62TVIvNXNuMkRujnUhWOPTtQ2fECvtXJEJ+yxDi4OUIuDRWPJn
         HDMDtO9GrwynEUSJUR8YbiFlV7csaB2bFfPOtwemjMGRxAp8cMsUl39FJbr7w0PfcprG
         DevtRrAbChZty0kdUIC2DDGsZy+PwmKqX9NxPnXHup7JKLrTra5yQPw26Xj0pxMdMaPf
         SyQ/wMG6NjHlczZXp8TxrTWOS2VlMz/q/xvX5PfEpVpllDXGJ6ASgHmTZ/oyQa1a2GQ8
         t1e9y9rXRZe5hVCe4/ZTLIBhyTlg2iVVagmtInJAlYvZVa/QKYr8q1jrvfVTiKva12xK
         DcOA==
X-Original-Authentication-Results: mx.google.com;       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
X-Gm-Message-State: AFeK/H0lEp4buzJFj7zGnSzxCYm7Rv6ASJ+KGhCsiaoxDSM69xGD0Xn+jwCRPgFG3//2v77b9hbZZkafywg+K/ho2mt6wzM=
X-Received: by 10.157.3.136 with SMTP id f8mr9797689otf.141.1489784985600;
        Fri, 17 Mar 2017 14:09:45 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.202.195.2 with SMTP id t2csp476038oif;
        Fri, 17 Mar 2017 14:09:44 -0700 (PDT)
X-Received: by 10.223.131.97 with SMTP id 88mr12887625wrd.129.1489784984674;
        Fri, 17 Mar 2017 14:09:44 -0700 (PDT)
Return-Path: <tiff-bounces@lists.maptools.org>
Received: from lists.maptools.org (ks365428.kimsufi.com. [94.23.4.142])
        by mx.google.com with ESMTP id j46si12603499wra.241.2017.03.17.14.09.44;
        Fri, 17 Mar 2017 14:09:44 -0700 (PDT)
Received-SPF: neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=94.23.4.142;
Authentication-Results: mx.google.com;
       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id B7D8235C066;
	Fri, 17 Mar 2017 16:09:00 -0500 (EST)
Received: from smtp.simplesystems.org (smtp.simplesystems.org [65.66.246.90])
	by lists.maptools.org (Postfix) with ESMTPS id E672335C064
	for <tiff@lists.maptools.org>; Fri, 17 Mar 2017 16:08:52 -0500 (EST)
Received: from scrappy.simplesystems.org (scrappy.simplesystems.org
	[65.66.246.73])
	by smtp.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id
	v2HL8fR5017582; Fri, 17 Mar 2017 16:08:41 -0500 (CDT)
Date: Fri, 17 Mar 2017 16:08:41 -0500 (CDT)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@scrappy.simplesystems.org
To: rleigh@codelibre.net
In-Reply-To: <18b5b63b7b889c5c3c9f51af1b2651c4@codelibre.net>
Message-ID: <alpine.GSO.2.20.1703171604260.4525@scrappy.simplesystems.org>
References: <CAHcSuBpB46=uPKCS48LuFCqbZ1GeQau6_f8Bbbj5fs6LbJdE+Q@mail.gmail.com>
	<alpine.GSO.2.20.1703170947500.4525@scrappy.simplesystems.org>
	<CAHcSuBqZQh4kJH_R_9LEkpnjRm=s-CmOE_vcoyRF6fxgwt1B8A@mail.gmail.com>
	<alpine.GSO.2.20.1703171154040.4525@scrappy.simplesystems.org>
	<18b5b63b7b889c5c3c9f51af1b2651c4@codelibre.net>
User-Agent: Alpine 2.20 (GSO 67 2015-01-07)
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(smtp.simplesystems.org [65.66.246.90]);
	Fri, 17 Mar 2017 16:08:41 -0500 (CDT)
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] TIFFSetErrorHandler vs TIFFSetErrorHandlerExt
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

On Fri, 17 Mar 2017, rleigh@codelibre.net wrote:
> Could I suggest a perhaps controversial but useful solution for handling
> errors, which might be worth your consideration.
>
> If the libtiff core were to use a C++ TIFF class reporting errors via
> exceptions, it would be possible for this to be wrapped by the existing
> C API calling the C++ code in a try/catch block and reporting any thrown
> errors via the handlers.  Or direct use by C++ code without any of that

Unfortunately, throwing C++ exceptions through C code is not portable. 
It would require that the using program to be linked using the C++ 
compiler.  The built library would only support one C++ compiler 
(perhaps just one of several C++ dialects supported by the same 
compiler) due to C++ compiler run-time libraries and name mangling.

I like C++ but libtiff needs to remain a plain C library.

The libtiff API can be improved to make it easier for C++ and threaded 
programs to use it more effectively.

Bob
-- 
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
