[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#362414: abs() returns a negative number & signed types are undefined on overflow (fwd)



reassign 362414 libsndfile
retitle 362414 lossy_comp_test fails because signed types are undefined on overflow
tags 362414 + patch
thanks

* Falk Hueffner <falk@debian.org> [2006-04-18 18:05]:
> > * Petr Salinger <Petr.Salinger@t-systems.cz> [2006-04-14 13:05]:
> >> Does help to compile it with "-fwrapv" ?
> > No.
> Are you sure? It does for me.

I added it to the wrong GCC call.  I can confirm that -fwrapv works
for me.

Anyway, reassigning to the package; they should probably just use
"long long" for sum_abs.  Thanks for everyone who commented on this
bug report.


--- tests~/lossy_comp_test.c	2006-03-16 08:35:04.000000000 +0100
+++ tests/lossy_comp_test.c	2006-04-18 19:16:23.000000000 +0200
@@ -683,8 +683,9 @@
 lcomp_test_int (const char *filename, int filetype, int channels, double margin)
 {	SNDFILE		*file ;
 	SF_INFO		sfinfo ;
-	int			k, m, *orig, *data, sum_abs ;
+	int		k, m, *orig, *data ;
 	long		datalen, seekpos ;
+	long long	sum_abs ;
 	double		scale ;
 
 	print_test_name ("lcomp_test_int", filename) ;

-- 
Martin Michlmayr
http://www.cyrius.com/



Reply to: