9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: C H Forsyth <forsyth@vitanuova.com>
To: russcox@gmail.com, 9fans@cse.psu.edu
Subject: Re: [9fans] am I nuts? does 8c support packed structs?
Date: Fri, 22 Oct 2004 16:49:31 +0100	[thread overview]
Message-ID: <5ae212d006c8c514c89c49f0258ebd36@vitanuova.com> (raw)
In-Reply-To: <ee9e417a0410220830359e8a7a@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

hj were only dicks on the mips it seems, but it's easy to add it to 8c.

diff /n/dump/2004/1022/sys/src/cmd/8c/swt.c /sys/src/cmd/8c/swt.c
589a590,591
> 		if(hjdickflg)
> 			w = hjdickflg;
597a600,601
> 		if(hjdickflg)
> 			w = hjdickflg;

t.c:

#include <u.h>
#pragma hjdicks dick
struct a {
	ulong x;
	long y;
	short z;
	};
#pragma hjdicks off
static int xxx = sizeof(struct a);
static struct a xx[2];
static int xxsize = sizeof(xx);

8c -S t.c

	DATA	xxx<>+0(SB)/4,$10
	DATA	xxsize<>+0(SB)/4,$20
	GLOBL	xxsize<>+0(SB),$4
	GLOBL	xx<>+0(SB),$20
	GLOBL	xxx<>+0(SB),$4

perhaps i should add "xen" as a synonym for "dick"
"on" will work too, if you'd like to be less rude.

also,
#pragma hjdicks xN
for some integer N sets the padding/rounding to N

[-- Attachment #2: Type: message/rfc822, Size: 3028 bytes --]

From: Russ Cox <russcox@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] am I nuts? does 8c support packed structs?
Date: Fri, 22 Oct 2004 11:30:21 -0400
Message-ID: <ee9e417a0410220830359e8a7a@mail.gmail.com>

#pragma hjdicks on

> struct a {
>         ulong x;
>         long y;
>         short z;
>         };

#pragma hjdicks off

  reply	other threads:[~2004-10-22 15:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-22 15:26 Ronald G. Minnich
2004-10-22 15:30 ` Russ Cox
2004-10-22 15:49   ` C H Forsyth [this message]
2004-10-22 16:37     ` Ronald G. Minnich
2004-10-22 16:54       ` C H Forsyth
2004-10-22 21:13         ` Bruce Ellis
2004-10-22 21:00           ` Charles Forsyth
2004-10-22 16:51     ` Russ Cox
2004-10-22 17:27       ` Ronald G. Minnich
2004-10-22 17:20     ` Ronald G. Minnich
2004-10-22 17:28       ` Russ Cox
2004-10-22 17:30         ` Ronald G. Minnich
2004-10-22 17:29       ` jmk
2004-10-22 17:31         ` Ronald G. Minnich
2004-10-22 17:50           ` Brantley Coile
2004-10-22 18:32         ` C H Forsyth
2004-10-22 18:14       ` Charles Forsyth
2004-10-22 19:25       ` boyd, rounin
2004-10-22 19:35         ` Ronald G. Minnich
2004-10-22 19:38           ` boyd, rounin

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=5ae212d006c8c514c89c49f0258ebd36@vitanuova.com \
    --to=forsyth@vitanuova.com \
    --cc=9fans@cse.psu.edu \
    --cc=russcox@gmail.com \
    /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).