HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- #pragma pack() in linux
Operating System - Linux
1828225
Members
2514
Online
109975
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-27-2003 02:33 AM
03-27-2003 02:33 AM
#pragma pack() in linux
what is a #pragma pack()? how to use it in gcc compiler.
send me the answer as soon as possible.
send me the answer as soon as possible.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2003 05:05 AM
03-27-2003 05:05 AM
Re: #pragma pack() in linux
pragma
An ANSI C command comment that conveys non-essential yet pragmatic information, often to help with optimization when compiling.
Here is a Red Hat link:
http://www.redhat.com/docs/manuals/gnupro/GNUPro-Toolkit-00r1/pdf/2_compile.pdf
Here is some HP info:
You typically use a #pragma directive to control the actions of the compiler in a particular portion of a translation unit without affecting the translation unit as a whole.
http://docs.hp.com/cgi-bin/otsearch/getfile?id=/hpux/onlinedocs/1559/pragmas.htm&searchterms=pragma&queryid=20030327-055643
An ANSI C command comment that conveys non-essential yet pragmatic information, often to help with optimization when compiling.
Here is a Red Hat link:
http://www.redhat.com/docs/manuals/gnupro/GNUPro-Toolkit-00r1/pdf/2_compile.pdf
Here is some HP info:
You typically use a #pragma directive to control the actions of the compiler in a particular portion of a translation unit without affecting the translation unit as a whole.
http://docs.hp.com/cgi-bin/otsearch/getfile?id=/hpux/onlinedocs/1559/pragmas.htm&searchterms=pragma&queryid=20030327-055643
Support Fatherhood - Stop Family Law
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2003 09:19 PM
03-28-2003 09:19 PM
Re: #pragma pack() in linux
hi,
Thanks for the information.
currently i am working with linux.i want's to use the #pragma pack() in nested structures.so please send me the
syntax with an example.
Thanks for the information.
currently i am working with linux.i want's to use the #pragma pack() in nested structures.so please send me the
syntax with an example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2003 05:29 AM
03-29-2003 05:29 AM
Re: #pragma pack() in linux
Hi,
from the gcc documentation :
`packed'
The `packed' attribute specifies that a variable or structure field
should have the smallest possible alignment--one byte for a
variable, and one bit for a field, unless you specify a larger
value with the `aligned' attribute.
Here is a structure in which the field `x' is packed, so that it
immediately follows `a':
struct foo
{
char a;
int x[2] __attribute__ ((packed));
};
HTH,Goran
from the gcc documentation :
`packed'
The `packed' attribute specifies that a variable or structure field
should have the smallest possible alignment--one byte for a
variable, and one bit for a field, unless you specify a larger
value with the `aligned' attribute.
Here is a structure in which the field `x' is packed, so that it
immediately follows `a':
struct foo
{
char a;
int x[2] __attribute__ ((packed));
};
HTH,Goran
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP