- Add pun.diff

OBS-URL: https://build.opensuse.org/package/show/science/librsb?expand=0&rev=5
This commit is contained in:
Jan Engelhardt 2017-04-30 00:27:19 +00:00 committed by Git OBS Bridge
parent bb10b95d6f
commit b29428f562
3 changed files with 35 additions and 1 deletions

View File

@ -7,6 +7,7 @@ Sat Apr 29 23:53:40 UTC 2017 - jengelh@inai.de
sparse matrices.
* rsb_file_mtx_save and rsb_file_vec_save's output use
full-precision.
- Add pun.diff
-------------------------------------------------------------------
Thu Oct 20 23:10:35 UTC 2016 - jengelh@inai.de

View File

@ -25,7 +25,9 @@ Summary: Shared memory parallel sparse matrix and sparse BLAS library
License: LGPL-3.0+
Group: Productivity/Scientific/Math
URL: http://librsb.sf.net/
Source: http://downloads.sf.net/%name/%name-%rversion.tar.gz
Patch1: pun.diff
BuildRequires: fdupes
BuildRequires: gcc-fortran
BuildRequires: gsl-devel
@ -67,9 +69,10 @@ applications that want to make use of librsb.
%prep
%setup -qn librsb-%rversion
%patch -P 1 -p1
%build
%configure --docdir="%_docdir/%name" --disable-static
%configure --docdir="%_docdir/%name" --disable-static CFLAGS="%optflags -Wno-unused"
make %{?_smp_mflags}
%install

30
pun.diff Normal file
View File

@ -0,0 +1,30 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: 2017-04-30 02:23:53.236493153 +0200
Stop punting the types pointers.
rsb_test_accuracy.c:117:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
RSB_NUMERICAL_TYPE_SET_ELEMENT_FROM_DOUBLE(eps,RSB_NORMWISE_BACKWARD_ERROR_TOLERANCE,typecode);
---
rsb_types.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: librsb-1.2.0-rc6/rsb_types.h
===================================================================
--- librsb-1.2.0-rc6.orig/rsb_types.h
+++ librsb-1.2.0-rc6/rsb_types.h
@@ -375,10 +375,10 @@ extern "C" {
switch(TYPE) \
{ \
/* supported (double,float,float complex,double complex) */ \
- case RSB_NUMERICAL_TYPE_DOUBLE : *(double*)(DST)=(double)(DSRC); break; \
- case RSB_NUMERICAL_TYPE_FLOAT : *(float*)(DST)=(float)(DSRC); break; \
- case RSB_NUMERICAL_TYPE_FLOAT_COMPLEX : *(float complex*)(DST)=(float complex)(DSRC); break; \
- case RSB_NUMERICAL_TYPE_DOUBLE_COMPLEX : *(double complex*)(DST)=(double complex)(DSRC); break; \
+ case RSB_NUMERICAL_TYPE_DOUBLE : { double z = (DSRC); memcpy(DST, &z, sizeof(z)); break; } \
+ case RSB_NUMERICAL_TYPE_FLOAT : { float z = (DSRC); memcpy(DST, &z, sizeof(z)); break; } \
+ case RSB_NUMERICAL_TYPE_FLOAT_COMPLEX : { float complex z = (DSRC); memcpy(DST, &z, sizeof(z)); break; } \
+ case RSB_NUMERICAL_TYPE_DOUBLE_COMPLEX : { double complex z = (DSRC); memcpy(DST, &z, sizeof(z)); break; } \
/* unsupported type */ \
default : ; \
} \