How use #pragma pack() in HP unix ?

hello.

i use follow sentences in include files in SCO unix is ok.
#pragma pack(1)
struct dddd {
int iD1;
char cCh1;
...
};
#pragma pack()

but in hp-9000 unix , not ok when compiling, cc not support
#pragma pack(1)

how to settle the question ?
thank you .

A "#pragma" by definition is implementation defined. A compiler is supposed to ignore a pragma that it doesn't understand. HP's c compiler does issue a warning, but it should compile.

I'm not familiar with the pragma that you are using. But I'll make a guess as to its function. It looks like your system has a choice of two ways to compile a structure. I would guess that one choice conserves memory while the other choice enhances execution speed. You won't get a choice like that on HP systems. HP's chip is designed for execution speed. But it has very strict memory alignment constraints. And so HP's compiler doesn't get a choice.

Ignore the warning or remove the pragma. If your program assumes a particular internal layout of a structure then it is not a portable program and you will probably have trouble.