Accepting request 398809 from home:badshah400:branches:openSUSE:Factory:Rings:2-TestDVD

Add upstream patch to actually fix problem with gcc >= 6; drop previous patch used to workaround issue.

OBS-URL: https://build.opensuse.org/request/show/398809
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=29
This commit is contained in:
Thomas Bechtold 2016-05-30 07:26:32 +00:00 committed by Git OBS Bridge
parent 01151b11a5
commit 68f8dd10a1
4 changed files with 50 additions and 14 deletions

View File

@ -1,13 +0,0 @@
Index: cffi-1.5.2/testing/cffi1/test_verify1.py
===================================================================
--- cffi-1.5.2.orig/testing/cffi1/test_verify1.py
+++ cffi-1.5.2/testing/cffi1/test_verify1.py
@@ -20,7 +20,7 @@ else:
extra_compile_args.append('-Qunused-arguments')
else:
# assume a standard gcc
- extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion']
+ extra_compile_args = ['-Werror', '-Wno-shift-negative-value', '-Wall', '-Wextra', '-Wconversion']
class FFI(FFI):
error = _cffi_backend.FFI.error

View File

@ -0,0 +1,39 @@
# HG changeset patch
# User Armin Rigo <arigo@tunes.org>
# Date 1464590378 -7200
# Node ID bc14c64da0f41ba70f6fab821540b376f78e0a85
# Parent f6d4b0a1e70b885352de186fcaeedf41365793c6
Issue #260: don't use "x << 0" but "x | 0" to check that x is an
integer. It seems that "x << 0" is undefined, according to the C
standard, if x is any negative value...
diff --git a/cffi/recompiler.py b/cffi/recompiler.py
--- a/cffi/recompiler.py
+++ b/cffi/recompiler.py
@@ -814,7 +814,7 @@
try:
if ftype.is_integer_type() or fbitsize >= 0:
# accept all integers, but complain on float or double
- prnt(" (void)((p->%s) << 1); /* check that '%s.%s' is "
+ prnt(" (void)((p->%s) | 0); /* check that '%s.%s' is "
"an integer */" % (fname, cname, fname))
continue
# only accept exactly the type declared, except that '[]'
@@ -991,7 +991,7 @@
prnt('static int %s(unsigned long long *o)' % funcname)
prnt('{')
prnt(' int n = (%s) <= 0;' % (name,))
- prnt(' *o = (unsigned long long)((%s) << 0);'
+ prnt(' *o = (unsigned long long)((%s) | 0);'
' /* check that %s is an integer */' % (name, name))
if check_value is not None:
if check_value > 0:
@@ -1250,7 +1250,7 @@
def _emit_bytecode_UnknownIntegerType(self, tp, index):
s = ('_cffi_prim_int(sizeof(%s), (\n'
- ' ((%s)-1) << 0 /* check that %s is an integer type */\n'
+ ' ((%s)-1) | 0 /* check that %s is an integer type */\n'
' ) <= 0)' % (tp.name, tp.name, tp.name))
self.cffi_types[index] = CffiOp(OP_PRIMITIVE, s)

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Sun May 29 05:23:27 UTC 2016 - badshah400@gmail.com
- Add python-cffi-avoid-bitshifting-negative-int.patch to actually
fix the "negative left shift" warning by replacing bitshifting
in appropriate places by bitwise and comparison to self; patch
taken from upstream git. Drop cffi-1.5.2-wnoerror.patch: no
longer required.
-------------------------------------------------------------------
Fri May 27 13:00:22 UTC 2016 - jmatejek@suse.com

View File

@ -25,7 +25,8 @@ Group: Development/Languages/Python
Url: http://cffi.readthedocs.org
Source0: https://pypi.io/packages/source/c/cffi/cffi-%{version}.tar.gz
Source1: python-cffi-rpmlintrc
Patch0: cffi-1.5.2-wnoerror.patch
# PATCH-FIX-UPSTREAM python-cffi-avoid-bitshifting-negative-int.patch boo#981848 badshah400@gmail.com -- Use bitwise AND instead of bitshifts to test for integer types; patch submitted upstream
Patch0: python-cffi-avoid-bitshifting-negative-int.patch
BuildRequires: gcc-c++
BuildRequires: python-devel
BuildRequires: python-setuptools