Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: gaf@zk3.dec.com (Gerald Feldman USG)
Subject: Re: Using #pragma pack(n)
Date: 31 Mar 1994 18:13:24 GMT	[thread overview]
Message-ID: <2nf3s4$roq@utne.zk3.dec.com> (raw)
In-Reply-To: CnGDE8.Jr4@unix.portal.com


|>In article <CnGDE8.Jr4@unix.portal.com>, sdr@shell.portal.com (Stephen Reagan) writes:
|>
|>We have tried using the pack pragma on DEC Alpha OSF v1.3,
|>but have so far been unsuccessful.  We have some structures
|>which contain both bit fields and floats; sometimes the C compiler
|>does not seem to align the structure members as we wish, hence the
|>attempt to use this pragma.
|>
|>In every case using this pragma with an argument less than 8, we
|>get a "strange" compiler error if a float is referenced in any way
|>using a structure pointer. I cannot find ANY useful documentation anywhere
|>which gives any meaningful insight or direction in terms of solving
|>this problem...
|>
|>Help!
|>
|>--Steve
|>
|>Here is an example:
|>
|>
|>Script started on Mon Mar 28 19:44:11 1994
|>(sreagan@sc01 1046) nl foo.c
|>     1	#include <stdio.h>
|>     2	#pragma pack(1)
|>     3	main()
|>     4	{
|>     5		struct balloon
|>     6		{
|>     7			float raft;
|>     8		} bubble;
|>     9		
|>    10		struct balloon *bubble_jet = &bubble;
|>    11		
|>    12		printf("Hello world\n");
|>    13		
|>    14		bubble.raft = 0.0;
|>    15		bubble_jet->raft = 0.0;
|>    16		
|>    17	}
|>(sreagan@sc01 1047) make foo
|>cc   foo.c  -o foo
|>ugen: internal  : line 15 : ../../../../../../src/usr/ccs/bin/ugen/eval.p,
|>line 2284
|>                can't do unaligned float iloads/istores
|>*** Exit 1
|>Stop.
|>(sreagan@sc01 1048) 
|>script done on Mon Mar 28 19:44:41 1994
|>-- 
This is a problem which was fixed in V2.0. V2.0 has been released. Please
see your Digital representative to obtain the upgrade.
sauron:assem [300%] cc foo.c
sauron:assem [301%] cc -std foo.c                                           
sauron:assem [302%] cc -std1 foo.c                                          
sauron:assem [303%] cc -std1 foo.c;a.out                                    
Hello world

Jerry Feldman

-- 
Jerry Feldman              Unix Systems Group
Digital Equipment Corp.    Mailstop: ZKO3-3/Y25 
110 Spitbrook Rd.          gaf@zk3.dec.com
Nashua, NH 03062-9987      (603)881-2970


      reply	other threads:[~1994-03-31 18:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-03-30  0:58 Using #pragma pack(n) Stephen Reagan
1994-03-31 18:13 ` Gerald Feldman USG [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox