9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Steve Hemminger sch@postman.ncube.com
Subject: botch on long long byte order
Date: Wed,  6 Sep 1995 18:32:20 -0400	[thread overview]
Message-ID: <19950906223220.6ZbPZL48mFzsqdsEbhoVL2D4UN5eSNqW8KUdv52Kw-E@z> (raw)

Order of elements in Length union is incorrect:

:Program to demonstrate:
-------------
#include <u.h>
#include <libc.h>

Length l;

void main(int argc, char *argv[]) {
	USED(argc, argv);

	l.length = 1; 
	l.hlength=0;

	print("should be 1 is %lld\n", l.vlength);

	l.hlength = 1;
	l.length = 0;
	print("should be 0x100000000 is %ullx\n", l.vlength);

	l.vlength = 1;

	print("should be 1 (0/1) is %lld (%ld/%ld)\n",
	      l.vlength, l.hlength, l.length);
}

: I get
-------------
should be 1 is 4294967296
should be 0x100000000 is 1
should be 1 (0/1) is 1 (1/0)
-------------

WARNING: putting them in the correct order (/386/include/u.h)
will mean rebuilding the world though since the file system is byte
order independant, the disk does not need to be reloaded.






                 reply	other threads:[~1995-09-06 22:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19950906223220.6ZbPZL48mFzsqdsEbhoVL2D4UN5eSNqW8KUdv52Kw-E@z \
    --to=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).