bug-textutils
[Top][All Lists]
Advanced

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

od -t x8 broken on 64 bit platforms


From: Arun Sharma
Subject: od -t x8 broken on 64 bit platforms
Date: Mon Sep 16 23:54:08 2002
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826

This bug report is against textutils-2.0.14 running on ia64.

$ od -t x4 file | head
0000000 00000000 20000000 fef583a1 00100001
0000020 00004000 20000000 feef43a1 00100001
0000040 00008000 20000000 feef03a1 00100001
0000060 0000c000 20000000 feeec3a1 00100001
0000100 00010000 20000000 feee83a1 00100001
0000120 00014000 20000000 feee43a1 00100001
0000140 00018000 20000000 feee03a1 00100001
0000160 0001c000 20000000 feedc3a1 00100001
0000200 00020000 20000000 fef343a1 00100001
0000220 00024000 20000000 fef2c3a1 00100001
$ od -t x8 file | head
0000000 0000000000000000 00000000fef583a1
0000020 0000000000004000 00000000feef43a1
0000040 0000000000008000 00000000feef03a1
0000060 000000000000c000 00000000feeec3a1
0000100 0000000000010000 00000000feee83a1
0000120 0000000000014000 00000000feee43a1
0000140 0000000000018000 00000000feee03a1
0000160 000000000001c000 00000000feedc3a1
0000200 0000000000020000 00000000fef343a1
0000220 0000000000024000 00000000fef2c3a1

As you can see, the higher bits are gone from the dump.

The following patch fixes the problem for me.

$ diff -u textutils-2.0.14/src/od.c- textutils-2.0.14/src/od.c
--- textutils-2.0.14/src/od.c-  Mon Sep 16 15:39:39 2002
+++ textutils-2.0.14/src/od.c   Mon Sep 16 15:50:16 2002
@@ -1634,7 +1634,8 @@
  integral_type_size[sizeof (int)] = INT;
  integral_type_size[sizeof (long int)] = LONG;
#if HAVE_UNSIGNED_LONG_LONG
-  integral_type_size[sizeof (ulonglong_t)] = LONG_LONG;
+  if (sizeof (ulonglong_t) > sizeof (long int))
+       integral_type_size[sizeof (ulonglong_t)] = LONG_LONG;
#endif

  for (i = 0; i <= MAX_FP_TYPE_SIZE; i++)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]