Hello,

> Besides that I see the following warning in the build log for -2:
>
> RawIP.xs: In function 'XS_Net__RawIP_timem':
> RawIP.xs:614:9: warning: format '%u' expects argument of type 'unsigned
> int', but argument 2 has type '__time_t' [-Wformat=]
>          RETVAL = newSVpvf("%u.%06u",tv.tv_sec,tv.tv_usec);
>          ^
> RawIP.xs:614:9: warning: format '%u' expects argument of type 'unsigned
> int', but argument 3 has type '__suseconds_t' [-Wformat=]

On my search in the web, if there was already some solution for 'my'
libnet-rawip-perl problem, I found two patches; these are attached. The
patch Net-RawIP-0.23-format.patch (from Redhat/Fedora) removes that format
problem; the patch nonreturn-in-nonvoid.patch (from OpenSuse) adds a
missing default:-part in a switch-statement.

Additionally, I attached a patch cc.patch for setting gcc-4.6 as compiler.
Of course, gcc-4.6 must be added to Build-Depends.

> BTW: I'm confused which package version built under which environment
> works or fails under which environment :)

libnet-rawip-perl_0.25-1+b2_amd64.deb works for me on a wheezy system. It
also works on a jessie system after downgrading some other packages.
libnet-rawip-perl_0.25-2_amd64.deb fails on a jessie system. Version
0.25-1+b2, rebuilt from package sources on a jessie system, also fails
there. But version 0.25-2, rebuilt from sources after adding the attached
patches and a Build-Depend on gcc-4.6, works.

Regards
  Christoph
diff -u Net-RawIP-0.25//util.c Net-RawIP-0.25_new//util.c
--- Net-RawIP-0.25//util.c	2007-04-03 03:59:40.000000000 -0700
+++ Net-RawIP-0.25_new//util.c	2009-09-14 14:22:10.000000000 -0700
@@ -170,6 +170,8 @@
 		return 8;
 	case DLT_RAW:
 		return 0;
+	default:
+		return 0;
 	}
 }
diff -up Net-RawIP-0.23/RawIP.xs~ Net-RawIP-0.23/RawIP.xs
--- Net-RawIP-0.23/RawIP.xs~	2007-07-19 07:58:24.000000000 +0200
+++ Net-RawIP-0.23/RawIP.xs	2008-07-30 05:28:09.000000000 +0200
@@ -611,7 +611,7 @@ CODE:
         croak("gettimeofday()");
     }
     else {
-        RETVAL = newSVpvf("%u.%06u",tv.tv_sec,tv.tv_usec);
+        RETVAL = newSVpvf("%lld.%06u",(long long)tv.tv_sec,(unsigned)tv.tv_usec);
     }
 OUTPUT:
     RETVAL
Use gcc-4.6 for compilation
Index: libnet-rawip-perl-0.25/Makefile.PL
===================================================================
--- libnet-rawip-perl-0.25.orig/Makefile.PL	2014-03-25 14:39:22.000000000 +0100
+++ libnet-rawip-perl-0.25/Makefile.PL	2014-03-25 14:40:56.000000000 +0100
@@ -66,6 +66,7 @@
     AUTHOR          => 'Sebastien Aperghis-Tramoni <[email protected]>',
     VERSION_FROM    => 'lib/Net/RawIP.pm', 
     ABSTRACT_FROM   => 'lib/Net/RawIP.pm', 
+    CC		   => 'gcc-4.6', 
     LIBS           => ['-lpcap'],   
     DEFINE         => $def,      
     INC            => '',      

Reply via email to