- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- Re: how can i use the #pragma pack() in following ...
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP