Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: sdr@shell.portal.com (Stephen Reagan)
Subject: Using #pragma pack(n)
Date: Wed, 30 Mar 1994 00:58:56 GMT	[thread overview]
Message-ID: <CnGDE8.Jr4@unix.portal.com> (raw)


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


             reply	other threads:[~1994-03-30  0:58 UTC|newest]

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