From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,8cb93c25750499fe X-Google-Attributes: gidf8c9b,public X-Google-Thread: fc89c,8cb93c25750499fe X-Google-Attributes: gidfc89c,public X-Google-Thread: fee84,8cb93c25750499fe X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-03-31 10:13:24 PST Xref: gmd.de comp.unix.osf.osf1:2792 comp.unix.questions:30924 comp.unix.programmer:13647 Path: gmd.de!Germany.EU.net!EU.net!howland.reston.ans.net!cs.utexas.edu!swrinde!ihnp4.ucsd.edu!pacbell.com!decwrl!pa.dec.com!crl.dec.com!utne.zk3.dec.com!sauron.zk3.dec.com!gaf From: gaf@zk3.dec.com (Gerald Feldman USG) Newsgroups: comp.unix.osf.osf1,comp.unix.questions,comp.unix.programmer Subject: Re: Using #pragma pack(n) Date: 31 Mar 1994 18:13:24 GMT Organization: Digital Equipment Corporation, Unix Systems Group Distribution: world Message-ID: <2nf3s4$roq@utne.zk3.dec.com> References: Reply-To: gaf@zk3.dec.com NNTP-Posting-Host: sauron.zk3.dec.com X-Newsreader: mxrn 6.18-5 Originator: gaf@sauron.zk3.dec.com |>In article , 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 |> 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