Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Using #pragma pack(n)
@ 1994-03-30  0:58 Stephen Reagan
  1994-03-31 18:13 ` Gerald Feldman USG
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Reagan @ 1994-03-30  0:58 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1994-03-31 18:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-03-30  0:58 Using #pragma pack(n) Stephen Reagan
1994-03-31 18:13 ` Gerald Feldman USG

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