Using long long on a 32 bit machine (x86) gives a whole new way to make
warnings: :-)

cc -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -Wall -fno-strict-aliasing 
-I/usr/local/include -Wall   -I./include  -DHAS_JIT -o test_main.o -c test_main.c
test_main.c: In function `main':
test_main.c:207: warning: long int format, different type arg (arg 4)
cc -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -Wall -fno-strict-aliasing 
-I/usr/local/include -Wall   -I./include  -DHAS_JIT -o global_setup.o -c global_setup.c
global_setup.c: In function `init_world':
global_setup.c:22: warning: implicit declaration of function 
`Parrot_PerlInt_class_init'
global_setup.c:23: warning: implicit declaration of function 
`Parrot_PerlNum_class_init'
global_setup.c:24: warning: implicit declaration of function 
`Parrot_PerlString_class_init'
global_setup.c:25: warning: implicit declaration of function 
`Parrot_PerlArray_class_init'


But no tests have failed yet as I type this. I really should go to bed.

Nicholas Clark

--- Configure.pl~       Mon Dec 31 22:06:48 2001
+++ Configure.pl        Tue Jan  1 02:16:02 2002
@@ -395,15 +395,34 @@
 
 foreach ('intvalsize', 'opcode_t_size') {
     my $which = $_ eq 'intvalsize' ? 'packtype_i' : 'packtype_op';
+    my $format;
     if (($] >= 5.006) && ($c{$_} == $c{longsize}) ) {
-        $c{$which} = 'l!';
+        $format = 'l!';
     }
     elsif ($c{$_} == 4) {
-        $c{$which} = 'l';
+        $format = 'l';
     }
-    else {
-        die "Configure.pl:  Unable to find a suitable packtype for $_.\n";
+    elsif ($c{$_} == 8 and $Config{quadtype}) {
+         # pp_pack is annoying, and this won't work unless sizeof(UV) >= 8
+        $format = 'q';
     }
+    die "Configure.pl:  Unable to find a suitable packtype for $_.\n"
+        unless $format;
+
+    my $test = eval {pack $format, 0};
+    unless (defined $test) {
+        die <<"AARGH"
+Configure.pl:  Unable to find a functional packtype for $_.
+               '$format' failed: $@
+AARGH
+    }
+    unless (length $test == $c{$_}) {
+        die sprintf <<"AARGH", $c{$_}, length $test;
+Configure.pl:  Unable to find a functional packtype for $_.
+               Need a format for %d bytes, but '$format' gave %d bytes.
+AARGH
+    }
+    $c{$which} = $format;
 }
 
 $c{packtype_n} = 'd';

Reply via email to