Add "-fno-strict-aliasing" to compilation flags

Fixes a slew of:
  "dereferencing type-punned pointer will break strict-aliasing rules"
warnings from GCC for lines of the form:
  Py_INCREF(Py_True);
and
  Py_INCREF(Py_False);

due to the cast from PyIntObject* to PyObject*

GCC is technically correct here; see:
  http://www.python.org/dev/peps/pep-3123/
though this is unlikely to lead to non-working machine code.
f38
David Malcolm 15 years ago
parent b05e574ecf
commit 7df176fd24

@ -4,7 +4,7 @@
Summary: Cryptography library for Python Summary: Cryptography library for Python
Name: python-crypto Name: python-crypto
Version: 2.3 Version: 2.3
Release: 1%{?dist} Release: 2%{?dist}
# Mostly Public Domain apart from parts of HMAC.py and setup.py, which are Python # Mostly Public Domain apart from parts of HMAC.py and setup.py, which are Python
License: Public Domain and Python License: Public Domain and Python
Group: Development/Libraries Group: Development/Libraries
@ -42,7 +42,7 @@ SHA), and various encryption algorithms (AES, DES, RSA, ElGamal etc.).
%{__chmod} -x src/_fastmath.c %{__chmod} -x src/_fastmath.c
%build %build
CFLAGS="%{optflags}" %{__python} setup.py build CFLAGS="%{optflags} -fno-strict-aliasing" %{__python} setup.py build
%install %install
%{__rm} -rf %{buildroot} %{__rm} -rf %{buildroot}
@ -74,6 +74,9 @@ PYTHONPATH=%{buildroot}%{python_sitearch} %{__python} pct-speedtest.py
%{python_sitearch}/Crypto/ %{python_sitearch}/Crypto/
%changelog %changelog
* Fri Sep 24 2010 David Malcolm <dmalcolm@redhat.com> - 2.3-2
- add "-fno-strict-aliasing" to compilation flags
* Fri Aug 27 2010 Paul Howarth <paul@city-fan.org> - 2.3-1 * Fri Aug 27 2010 Paul Howarth <paul@city-fan.org> - 2.3-1
- Update to 2.3 - Update to 2.3
- Fix NameError when attempting to use deprecated getRandomNumber() function - Fix NameError when attempting to use deprecated getRandomNumber() function

Loading…
Cancel
Save