Path: chuka.playstation.co.uk!news From: "Jon Prestidge (Jon@surfed.to)" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Ten bytes bug in gcc? Date: Wed, 15 Aug 2001 16:13:27 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 25 Message-ID: <9le3jl$fio6@www.netyaroze-europe.com> References: <01c124b1$16cc8cc0$LocalHost@pal-s-omnibook> <9lbdjv$ds71@www.netyaroze-europe.com> <01c1250d$76401bc0$501ce4d5@pal-s-omnibook> <3B7A41C2.B4C5098E@127.0.0.1> <01c12570$15068c00$a708e4d5@pal-s-omnibook> <3B7A4B22.F0AB3595@127.0.0.1> NNTP-Posting-Host: host213-122-73-135.btinternet.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 I had a problem once that took me a couple of days to sort-out, I was passing an SVECTOR to a routine (somthing like ApplyMatrix but I can't remember for sure) and it was crashing.... in the end I found that it was because the SVECTOR had an address that was not divisable by 4 (but it was divisable by 2 -- it wasn't an 'odd address'). No one beleived me when I posted it on the news group but I tested it until the cows came home putting the structure at different addresses and that was definately the problem as far as I'm concerned. Actually all the structures supplied by Sony that I've checked have a size that is divisable by 4... and I checked quite a lot of them after I'd had that bug, and now I also always make sure that all the fields in my structures are arranged to start on 4 byte boundries (unless a field has a size of less than 4 bytes anyway), and I make sure that the size of all my structures are divisable by 4. By the way in CW there are some pragmas that you can use to force alignment at various points perhaps your compiler recognises them too -- they might be useful if you ever suspect the the compiler being incompetent. Jon