Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Aug 2015 18:47:18 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 202660] Fix lang/ruby21 installed header to fix signed shift warnings for other ports (e.g. devel/rubygem-thrift)
Message-ID:  <bug-202660-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202660

            Bug ID: 202660
           Summary: Fix lang/ruby21 installed header to fix signed shift
                    warnings for other ports (e.g. devel/rubygem-thrift)
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ruby@FreeBSD.org
          Reporter: dim@FreeBSD.org
          Assignee: ruby@FreeBSD.org
             Flags: maintainer-feedback?(ruby@FreeBSD.org)

Created attachment 160356
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=160356&action=edit
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 gives
errors with a recent clang 3.7.0 snapshot:

http://package18.nyi.freebsd.org/data/headi386PR201377-default/2015-08-20_15h42m20s/logs/errors/rubygem-thrift-0.9.1,1.log

This is because it includes ruby.h from the lang/ruby21 port, which uses this
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-202660-13>