- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: how can i use the #pragma pack() in following ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2003 10:23 PM
03-30-2003 10:23 PM
how can i use the #pragma pack() in following example
thanks for the information.
because of U i have got a new point.but till now also my problem was didn't solved.
i am using the #pragma pack()
in my example like following
#include
#pragma pack(push,<4>)
typedef struct messageheader
{
char x[2];
long logtime;
char alphachar[2];
short transactioncode;
short errorcode;
}msg;
#pragma pack(push)
#pragma pack(push,<4>)
typedef struct logonrequest
{
msg h;
short userid;
char pwd[8];
char newpwd[8];
char reserved[30];
}logon;
#pragma pack(push)
while running this program i am getting warnings like this:
malformed '#pragma pack(push[,id],
so,please make a solution for this and send it to me.
- Tags:
- pragma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2003 11:52 PM
03-31-2003 11:52 PM
Re: how can i use the #pragma pack() in following example
struct foo {
int bar;
int baz;
} __attributes__ ((
gcc does not recognize #pragma push and #pragma pop, those two pragmas are msvc++ #pragmas, if I am not mistaken.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2003 01:42 AM
04-01-2003 01:42 AM
Re: how can i use the #pragma pack() in following example
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xb230b941255cd71190080090279cd0f9,00.html
But they're obviously ignoring it.
G.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2013 04:23 AM - edited 12-25-2013 04:24 AM
12-25-2013 04:23 AM - edited 12-25-2013 04:24 AM
Re: how can i use the #pragma pack() in following example
Over 10 years later, I ran into the same problem and found this post, which was unhelpful. Later I found the problem myself, it consists of two parts:
1. gcc doesn't support #pragma pack up to version 2.96
2. gcc 2.96 and up supports #pragma pack, but at least the version I'm using (WindRiver's ccppc 2.96) supports it only if the line endings are Unix style (LF only).
Hope I'll be helpful for someone in the future.