The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
If the AIX need reboot after install fix pack or APAR? rainbow_bean AIX 3 01-05-2008 03:51 AM
Pack current folder WebWatch UNIX for Dummies Questions & Answers 3 12-17-2007 02:46 AM
Aix - Service Pack BabylonRocker AIX 1 10-18-2006 01:54 AM
Perl help!! (pack()?) Euler04 Shell Programming and Scripting 2 10-18-2005 07:58 AM
HP-UX UNIX Software v.10.20 Pack normreeves UNIX for Dummies Questions & Answers 1 01-07-2002 10:59 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-03-2002
Registered User
 

Join Date: Oct 2001
Posts: 7
Question 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 .
Reply With Quote
Forum Sponsor
  #2  
Old 03-04-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,663
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:12 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0