From owner-freebsd-arch@FreeBSD.ORG Sat Feb 7 01:18:09 2015 Return-Path: Delivered-To: freebsd-arch@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 050B0ABB for ; Sat, 7 Feb 2015 01:18:09 +0000 (UTC) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0145.outbound.protection.outlook.com [65.55.169.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F06EBA9 for ; Sat, 7 Feb 2015 01:18:08 +0000 (UTC) Received: from CO2PR05CA042.namprd05.prod.outlook.com (10.141.241.170) by DM2PR05MB447.namprd05.prod.outlook.com (10.141.104.150) with Microsoft SMTP Server (TLS) id 15.1.75.20; Sat, 7 Feb 2015 01:03:48 +0000 Received: from BY2FFO11FD016.protection.gbl (2a01:111:f400:7c0c::145) by CO2PR05CA042.outlook.office365.com (2a01:111:e400:1429::42) with Microsoft SMTP Server (TLS) id 15.1.81.19 via Frontend Transport; Sat, 7 Feb 2015 01:03:47 +0000 Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by BY2FFO11FD016.mail.protection.outlook.com (10.1.14.148) with Microsoft SMTP Server (TLS) id 15.1.87.10 via Frontend Transport; Sat, 7 Feb 2015 01:03:47 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF02-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Fri, 6 Feb 2015 17:03:45 -0800 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t1713iW49292; Fri, 6 Feb 2015 17:03:44 -0800 (PST) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 3598F580A3; Fri, 6 Feb 2015 17:03:44 -0800 (PST) To: Anuranjan Shukla Subject: Re: Buggy sbspace() on 64bit builds? In-Reply-To: References: <20150206183036.S1246@besplex.bde.org> Comments: In-reply-to: Anuranjan Shukla message dated "Fri, 06 Feb 2015 22:19:48 +0000." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Fri, 6 Feb 2015 17:03:44 -0800 Message-ID: <5977.1423271024@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.16 as permitted sender) Authentication-Results: spf=softfail (sender IP is 66.129.239.16) smtp.mailfrom=sjg@juniper.net; freebsd.org; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:66.129.239.16; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(76506005)(50466002)(57986006)(92566002)(117636001)(46102003)(50986999)(76176999)(6806004)(19580405001)(19580395003)(86362001)(50226001)(47776003)(2950100001)(110136001)(87936001)(105596002)(48376002)(1941001)(62966003)(77156002)(77096005)(33716001)(106466001)(42262002)(62816006); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR05MB447; H:P-EMF02-SAC.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR05MB447; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:DM2PR05MB447; X-Forefront-PRVS: 0480A51D4A X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:DM2PR05MB447; X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2015 01:03:47.1800 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.16] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR05MB447 Cc: "freebsd-arch@freebsd.org" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2015 01:18:09 -0000 Anuranjan Shukla wrote: > this, along with return value being 'int' acceptable as a final > determination? It is ok for the function to return long, so long as an int is used internally. Casting the int to long - implicit on return does no harm. #include #include #include int main(int argc, char *argv[]) { uint a, b; long r1; int r2; a = 1; b = 2; r1 = a - b; r2 = a - b; printf("r1=%ld\nr2=%d\nr3=%ld\n", r1, r2, (long)r2); exit(0); } r1=4294967295 r2=-1 r3=-1 so I think just using 'int' internally should work for now, perhaps with a comment saying the object size should match those being subtracted etc.