From owner-freebsd-questions@FreeBSD.ORG Wed Jan 8 19:19:27 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04CFDC50 for ; Wed, 8 Jan 2014 19:19:27 +0000 (UTC) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F2281848 for ; Wed, 8 Jan 2014 19:19:25 +0000 (UTC) Received: from [192.168.1.35] (mux.fjl.org.uk [62.3.120.246]) (authenticated bits=0) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id s08JJH56033060 (version=TLSv1/SSLv3 cipher=DHE-DSS-CAMELLIA256-SHA bits=256 verify=NO) for ; Wed, 8 Jan 2014 19:19:18 GMT (envelope-from frank2@fjl.co.uk) Message-ID: <52CDA4B6.2020300@fjl.co.uk> Date: Wed, 08 Jan 2014 19:19:18 +0000 From: Frank Leonhardt User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: python warning References: <53434003.HmthDSXb49@lumiwa.farms.net> In-Reply-To: <53434003.HmthDSXb49@lumiwa.farms.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.17 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2014 19:19:27 -0000 On 08/01/2014 18:37, Ajtim wrote: > Hi! > > My system: > FreeBSD 10.0-RC4 #0 r260130: Tue Dec 31 17:10:01 UTC 2013 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 > > I had bellow warnings in mail from version FreeBSD 10.0-ALPHA and it is still on. Do I need to make some settings or..., please? > Thank you. > > +WARNING pid 1752 (python2.7): ioctl sign-extension ioctl ffffffff80087467 > +WARNING pid 1762 (python2.7): ioctl sign-extension ioctl ffffffff80087467 I hate snakes! As to this, in case no one comes by that knows the answer, this wouldn't worry me greatly. ioctl takes values that are unsigned long; generally considered to be 32-bit unsigned values except when it's not. gcc defaults to 64-bit on AMD64. I have a horrible feeling that CLANG doesn't, and that FreeBSD 10 uses CLANG instead of gcc. I haven't been brave enough to try it. OpenCL specifies that long will be 64-bit regardless of platform, but that doesn't make it true. This is obviously bleating about a 64-bit value which looks like a -ve 32-bit number (high bit set). Compilers moving a signed integer value into a type with more bits WILL sign-extend, which means the high bit is propagated through the "new" high-order bits. HOWEVER, when the device driver is checking for commands it's not going to worry about the high-order bits - if its expecting a 32-bit scalar but the architecture gives it 64-bit instead it's not going to matter. It'll either check bit 31 (which remains unchanged) or, worst case, test for -ve (in which case you want the sign extend). It shouldn't do this, of course, because it's not a signed number and therefore can only be +ve. Hence the bleat. Methinks there's probably a line in python that's calling ioctl with an int instead of a ulong, and I bet CLANG comes in to it somewhere. Regards, Frank.