__attribute__( ( packed ) ) ignored by WICED compiler.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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?

0 Likes
1 Solution

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.

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

Hi henryubnt

Please have a look at the include directories in the header files.

Thanks,

Kevin

0 Likes
Anonymous
Not applicable

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.

0 Likes

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.

0 Likes