- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Broadcom helpers,
We use some GNU C __attribute__ mechanism, but when we used
__attribute__( ( packed ) )
It shows a lot of warning like below:
warning: 'packed' attribute ignored [-Wattributes]
How do we enable this setting in compiler?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Double check your syntax. Nothing needs to be done to enable structure packing. The attribute is correct, but perhaps you have it in the wrong place in the structure definition.
The PACKED key word is used for ARM RV compiler toolchain is not applicable to GCC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Kevin,
Not exactly understanding what you want to explain. I saw the below items:
#pragma pack(1)
.....
typedef PACKED struct
{
.....
}
.....
#pragma pack()
I may know the 2 pragma means the area to pack as 1 byte alignment, but what the PACKED syntax mean? Prevent to pack or force to pack again?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Double check your syntax. Nothing needs to be done to enable structure packing. The attribute is correct, but perhaps you have it in the wrong place in the structure definition.
The PACKED key word is used for ARM RV compiler toolchain is not applicable to GCC.