From owner-freebsd-ruby@freebsd.org Tue Aug 25 18:47:18 2015 Return-Path: Delivered-To: freebsd-ruby@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1A1999A6E7 for ; Tue, 25 Aug 2015 18:47:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id CA600DE2 for ; Tue, 25 Aug 2015 18:47:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id C783D99A6E6; Tue, 25 Aug 2015 18:47:18 +0000 (UTC) Delivered-To: ruby@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C71C199A6E5 for ; Tue, 25 Aug 2015 18:47:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B71BDDE1 for ; Tue, 25 Aug 2015 18:47:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PIlIwv098056 for ; Tue, 25 Aug 2015 18:47:18 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: ruby@FreeBSD.org Subject: maintainer-feedback requested: [Bug 202660] Fix lang/ruby21 installed header to fix signed shift warnings for other ports (e.g. devel/rubygem-thrift) Date: Tue, 25 Aug 2015 18:47:18 +0000 X-Bugzilla-Type: request Message-ID: In-Reply-To: References: X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-ruby@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD-specific Ruby discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2015 18:47:19 -0000 Dimitry Andric has reassigned Bugzilla Automation 's request for maintainer-feedback to ruby@FreeBSD.or= g: Bug 202660: Fix lang/ruby21 installed header to fix signed shift warnings f= or other ports (e.g. devel/rubygem-thrift) https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D202660 --- Description --- Created attachment 160356 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D160356&action= =3Dedit Fix signed left-shifting in lang/ruby21's public ruby.h During the exp-run in bug 201377, it was found that devel/rubygem-thrift gi= ves errors with a recent clang 3.7.0 snapshot: http://package18.nyi.freebsd.org/data/headi386PR201377-default/2015-08-20_1= 5h42 m20s/logs/errors/rubygem-thrift-0.9.1,1.log This is because it includes ruby.h from the lang/ruby21 port, which uses th= is macro: #define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG)) Unfortunately, left-shifting negative 'i' values is undefined behavior, so clang warns about this. I changed the macro to: #define INT2FIX(i) ((VALUE)(((VALUE)(i))<<1 | FIXNUM_FLAG)) which avoids the undefined behavior by casting to VALUE (which is unsigned) first. I ran all ruby21 tests before and after this fix, and I got "1 failures, 4 errors" in both cases, so no regressions. However, since this is a public ruby header, I can imagine that this is a change that makes some people nervous. So if ruby maintainers prefer to fix this in the devel/rubygem-thrift port instead, for example by squelching the warning, please let me know.=