From owner-freebsd-ports@FreeBSD.ORG Sat Mar 14 21:03:10 2015 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67900481 for ; Sat, 14 Mar 2015 21:03:10 +0000 (UTC) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) (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 28124C0 for ; Sat, 14 Mar 2015 21:03:10 +0000 (UTC) Received: by iegc3 with SMTP id c3so147516230ieg.3 for ; Sat, 14 Mar 2015 14:03:09 -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:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=WODPCc5jZfYcqgd/reoBgptPJFKfBV/fqQdbVUMqV+w=; b=kIQIUK/zhQzM1ae5QEjew4P2ixQQzNPZSMkIlkfcCMC9UHp2NL5joZNvULb3GMFP6z HeiJylB42trhWSBL7/kKJtFMfjPjck+q4Xl7YlJ6ZNMdc/DQaHmm8erRTGW/gF8YTVmh aFJ7O0Wvq7U4tN/2OaazesxENZw6MHec2AWggU8DOHSm8z89Q0xwFcgFD5fiaMGIc8+5 SHm6l32U4Wlu2LwTVMPSYo4/uLC/KEPa1hoCauh8z7M7E8fsDvG9dSaE7kSQol/cMJCT QlLZ8kroxMoPBEPBG3+CbUI4Qna+XQAc3ZNbYvULK00Fmg7MvREFEgjMnnYZuuaxp/r+ cwzw== X-Received: by 10.107.154.73 with SMTP id c70mr4866052ioe.22.1426366989422; Sat, 14 Mar 2015 14:03:09 -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 p76sm3850178iop.14.2015.03.14.14.03.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Mar 2015 14:03:08 -0700 (PDT) Message-ID: <5504A209.3030608@gmail.com> Date: Sat, 14 Mar 2015 15:03:05 -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: Christian Weisgerber , freebsd-ports@freebsd.org Subject: Re: converters/iconv versioning References: <54FF75A2.4020803@gmail.com> <54FF8A19.3090700@gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: Sat, 14 Mar 2015 21:03:10 -0000 On 14/03/2015 13:08, Christian Weisgerber wrote: > On 2015-03-11, Scott Furry wrote: >> 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. > POSIX says: > > size_t iconv(iconv_t cd, char **restrict inbuf, > size_t *restrict inbytesleft, char **restrict outbuf, > size_t *restrict outbytesleft); > > For GNU iconv, whether you have a const in the prototype or not is > configurable. I think by default it tries to match the prototype > of an existing iconv on the machine. The FreeBSD port specifically > asks for the const, presumably for consistency with earlier versions. Christian, Ran into a situation with other code where clang would issue a warning about calling iconv function without const variable. That's when I discovered the difference with FreeBSD's iconv (sorry, haven't memorized the handbook or porters handbook ;-) ). The function declaration you show matches what I've seen on both Mac and Linux. So iconv being used on FreeBSD differs from posix? Custom iconv Just seemed odd. Had to ask. Thanks for filling in a blank. Scott