Busybox awk on 64-bit architectures?

Rob Landley rob at landley.net
Thu Sep 1 06:10:50 UTC 2005


Somebody says that awk is broken on amd64, because sizeof(long)!=sizeof(int) 
and this causes dandruff and makes milk go bad faster:

http://bugs.busybox.net/view.php?id=17

Their proposed fix to the bug they hit is this:

diff -ur busybox-1.00-rc3/editors/awk.c busybox-1.00-rc3-/editors/awk.c
--- busybox-1.00-rc3/editors/awk.c 2004-07-31 01:52:08.000000000 +0200
+++ busybox-1.00-rc3-/editors/awk.c 2005-01-16 18:53:12.217614216 +0100
@@ -1890,7 +1891,7 @@
  int i, l, ll, n;
 
  tv = nvalloc(4);
- isr = info = op->info;
+ isr = info = (unsigned int) op->info;
  op = op->l.n;
 
  av[2] = av[3] = NULL;

Which just seems wrong, somehow.  I looked at the code a bit and noticed that 
A) it's over 2700 lines implementing a language I know less than 10% of, B) I 
don't own 64 bit hardware, C) awk is full of other "unsigned long" instances, 
D) this patch takes an assignment between "unsigned long" and "unsigned long" 
and sticks a typedef in there to something else.  (There's no _way_ that's 
the correct fix to whatever the problem is...)

Do you think you could take a look at it?

Rob



More information about the busybox mailing list