Package: altree
Severity: minor
Usertags: clang-ftbfs
User: [email protected]
Tag: patch


Hello,

Using the rebuild infrastructure, your package fails to build with clang 
(instead of gcc).

Thanks,
Arthur
diff -Naur altree.orig/altree-1.3.1/debian/changelog altree/altree-1.3.1/debian/changelog
--- altree.orig/altree-1.3.1/debian/changelog	2013-12-13 16:38:21.000000000 -0600
+++ altree/altree-1.3.1/debian/changelog	2014-03-27 19:16:36.626359549 -0500
@@ -1,3 +1,13 @@
+altree (1.3.1-2) unstable; urgency=low
+
+  * Fix FTBFS with clang:
+    - Fixed 'Function definition is not allowed here' error
+    - In CUtils/c_sources/rhyper.c I removed the compute function
+      and I moved the code into the else if clause
+    - Variable i from compute is now x and n is now i      
+
+ -- Arthur Marble <[email protected]>  Thu, 27 Mar 2014 19:16:36 -0500
+
 altree (1.3.1-1) unstable; urgency=low
 
   * New upstream release
diff -Naur altree.orig/altree-1.3.1/debian/patches/clang-ftbfs.diff altree/altree-1.3.1/debian/patches/clang-ftbfs.diff 
--- altree.orig/altree-1.3.1/debian/patches/clang-ftbfs.diff	1969-12-31 18:00:00.000000000 -0600
+++ altree/altree-1.3.1/debian/patches/clang-ftbfs.diff	2014-03-27 19:18:52.698361918 -0500
@@ -0,0 +1,67 @@
+--- a/CUtils/c_sources/rhyper.c
++++ b/CUtils/c_sources/rhyper.c
+@@ -52,6 +52,10 @@
+  *	   If (i > 7), use Stirling's approximation, otherwise use table lookup.
+ */
+ 
++double compute(int n) {
++};
++
++
+ static double afc(int i)
+ {
+     static int computed=10;
+@@ -70,27 +74,6 @@ static double afc(int i)
+ 	12.8018274800814696,/*ln(9!)*/
+ 	15.1044125730755153,/*ln(10!)*/
+     };
+-    double compute(int n) {
+-	static long double cur=3628800;
+-	static int i=11;
+-	static volatile int mutex=0;
+-
+-	while (__sync_lock_test_and_set(&mutex, 1)) {
+-		/* Internal loop with only read to avoid cache line ping-pong
+-		   on multi-processors */
+-		while(mutex) {
+-			/* spinlock */
+-		}
+-	}
+-
+-	for(; i<=n; i++) {
+-		cur*=i;
+-		al[i+1]=logl(cur);
+-	}
+-	computed=n;
+-	__sync_lock_release(&mutex);
+-	return al[i];
+-    };
+ 
+     double di, value;
+ 
+@@ -100,7 +83,24 @@ static double afc(int i)
+     } else if (i <= computed) {
+ 	value = al[i + 1];
+     } else if (i <= 1754) {
+-	value = compute(i);
++	static long double cur=3628800;
++	static int x=11;
++	static volatile int mutex=0;
++
++	while (__sync_lock_test_and_set(&mutex, 1)) {
++	     /* Internal loop with only read to avoid cache line ping-pong
++		on multi-processors */
++	     while(mutex) {
++		 /* spinlock */
++	     }
++	 }
++
++	 for(; x<=i; x++) {
++	     cur*=i;
++	     al[i+1]=logl(cur);
++	 }
++	 computed=i;
++         __sync_lock_release(&mutex);
+     } else {
+ 	di = i;
+ 	value = (di + 0.5) * log(di) - di + 0.08333333333333 / di
diff -Naur altree.orig/altree-1.3.1/debian/patches/series altree/altree-1.3.1/debian/patches/series 
--- altree.orig/altree-1.3.1/debian/patches/series	1969-12-31 18:00:00.000000000 -0600
+++ altree/altree-1.3.1/debian/patches/series	2014-03-27 18:50:00.978331761 -0500
@@ -0,0 +1 @@
+clang-ftbfs.diff

Reply via email to