From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,a3e7a54875d85e53 X-Google-Attributes: gidfee84,public X-Google-Thread: fcda7,a3e7a54875d85e53 X-Google-Attributes: gidfcda7,public X-Google-Thread: fc89c,a3e7a54875d85e53 X-Google-Attributes: gidfc89c,public From: "Mike Holland" Subject: Re: Porting from Compaq Alpha to HP-UX Date: 2000/02/01 Message-ID: <876e69$4ui@romeo.logica.co.uk>#1/1 X-Deja-AN: 580294517 References: <873qtt$fds@romeo.logica.co.uk> <2000Jan31.083911.1@eisner> <2000Jan31.141639.1@eisner> Organization: Logica UK Limited X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: comp.sys.hp.hpux,comp.unix.osf.osf1,comp.unix.programmer Thanks for that. Actually, I think I'll be OK with my alignment since the application has all its data explicitly padded so that it lies on natural boundaries. Where I'm expecting the real trouble is where bit-fields have been used: the Alpha compiler puts the first bit-field it finds at the least significant end of the word, whereas the HP-UX puts it at the most significant end. So any assumptions about the layout of bitfield go horribly wrong! It's expecially horrible where unions are involved. Mike Holland Bob Koehler wrote in message <2000Jan31.141639.1@eisner>... >In article <873qtt$fds@romeo.logica.co.uk>, "Mike Holland" writes: >> I need to port a large-ish application (about a million lines of 'C' code) >> from Compaq Alpha UNIX 4.0e to run additionally on HP-UX. It will be >> particularly entertaining because the application exchanges messages with >> programs running on Windows NT. >> > > Something I missed on the first followup. On Compaq UNIX you can > control whether structure and union fields are naturally aligned or > packed. On HP-UX you can't. I've had trouble getting two programs > which used the same .h file to declare a struct on HP-UX to agree > how the data should be aligned. So if you do read and writes of > entire structs you may have to re-write it as field-by-field I/O. > >---------------------------------------------------------------------- >Bob Koehler | Computer Sciences Corporation >Hubble Space Telescope Payload | Federal Sector, Civil Group > Flight Software Team | please remove ".aspm" when replying