From owner-freebsd-ports@FreeBSD.ORG Wed Mar 11 00:27:48 2015 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B94F647F for ; Wed, 11 Mar 2015 00:27:48 +0000 (UTC) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79A58BD9 for ; Wed, 11 Mar 2015 00:27:48 +0000 (UTC) Received: by iecsf10 with SMTP id sf10so287735iec.2 for ; Tue, 10 Mar 2015 17:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=dICMdqRUg8B8BhCnLf6PyDN1LxNMHF2mCvg82wietHs=; b=k9EdrqVioMFQfACPAjygyT8yPCo1Jlstt8miXLfRuZFguRY10X0R129Vx4io4HTp3y gZS9l1y6Kqeb0mw4Ncm3LievPpOh/xZJPc6FqN6uLjSW6xXRuQqcAXs1pDjsczrW+eES 2tTBtA9EUbVzgl8P/qcajMEVUuMMvXY7nkuKkTKw9vL7r0KpqGKzQW0xZROqHeAt2ixH vF24fIzo3iTbDZUI5RiujOonf0UsS5nWtmXRd+cPpZc78s8HR3zoPa+0PgHfQ1Lqbw05 3pDHPng+vjnO+55OOLK0dy1qMZ9ZmVV/wMPWPVnCPC3e2TKS1FCKJRtiTpm/6XsErZyP aMNA== X-Received: by 10.50.171.170 with SMTP id av10mr87287020igc.28.1426033179930; Tue, 10 Mar 2015 17:19:39 -0700 (PDT) Received: from [10.0.1.155] (d205-206-84-235.abhsia.telus.net. [205.206.84.235]) by mx.google.com with ESMTPSA id f1sm1465865igt.14.2015.03.10.17.19.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 17:19:39 -0700 (PDT) Message-ID: <54FF8A19.3090700@gmail.com> Date: Tue, 10 Mar 2015 18:19:37 -0600 From: Scott Furry User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ben Woods Subject: Re: converters/iconv versioning References: <54FF75A2.4020803@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-ports@freebsd.org" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 00:27:48 -0000 On 10/03/2015 18:05, Ben Woods wrote: > On Wednesday, March 11, 2015, Scott Furry > wrote: > > I am running into in a situation with other C code where a call to > iconv and passing in a non-const source buffer would result in a > build warning. Others who use the same code on other platforms do > not report this warning. > > In tracking down the issue, I have discovered that there may be a > difference in the iconv.h header file used on FreeBSD versus > Mac/Linux et al. > > http://www.opensource.apple.com/source/libiconv/libiconv-30/install/iconv.h > line 48 shows that call to iconv > ----- > size_t iconv (iconv_t /*cd*/, > char ** __restrict /*inbuf*/, size_t * __restrict > /*inbytesleft*/, > char ** __restrict /*outbuf*/, size_t * __restrict > /*outbytesleft*/); > ---- > > /usr/local/include/iconv.h, line 83, shows something rather different. > Even the commentary around the code is different. > ----- > extern size_t iconv (iconv_t cd, const char* * inbuf, size_t > *inbytesleft, char* * outbuf, size_t *outbytesleft); > ----- > > > My question is this, are we using a different or FreeBSD-specific > version of iconv? > > S > > > FreeBSD has its own native iconv (since FreeBSD 10). > > More details (including reference to commits) here: > https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/using-iconv.html > > Regards, > Ben Okay...different iconv. But what's the reason for change? And does this one function call really need to be const? Is the __restrict in the type not used on FreeBSD? Seems strange to differ on a gnu-based. S