packed Questions

7

Solved

I am going though some C code written for the Microchip C30 compiler and I often see structs defined as follows: typedef struct __attribute__((__packed__)) { IP_ADDR MyIPAddr; // IP address IP_...
Isomorph asked 29/3, 2011 at 13:21

2

The spec (GCC type attributes amongst others) states that __attribute__((packed)) can be applied to a struct or a union. Since all union fields' storage overlap, what does the attribute actually do...
Finedrawn asked 10/3, 2022 at 12:46

3

Solved

Are unpacked struct in packed struct automatically packed by GCC? In other words, do __packed__ attribute automatically propagates to nested structures? That is to say: struct unpackedStruct{ int1...
Zeke asked 26/2, 2021 at 15:52

9

Solved

I have some code on a Cortex-M4 microcontroller and'd like to communicate with a PC using a binary protocol. Currently, I'm using packed structs using the GCC-specific packed attribute. Here is a ...
Dragelin asked 15/7, 2017 at 8:35

4

Solved

While reviewing some code in our legacy Delphi 7 program, I noticed that everywhere there is a record it is marked with packed. This of course means that the record is stored byte-for-byte and not ...
Alpha asked 11/10, 2011 at 22:10

1

Solved

I have a struct of 4 fields of types that come from template parameters: template <typename T1, typename T2, typename T3, typename T4> struct __attribute__((aligned(8))) four_tuple { typede...
Pinnatifid asked 8/1, 2016 at 7:28

1

I use g++ to compile code with packed fields. However, I receive an error when trying to return a reference to a packed field. Example: struct __attribute__((packed)) Foo { int* ptr; uint16_t ...
Gabriellia asked 15/12, 2014 at 19:17

2

Solved

I am working with structs in c on linux. I started using bit fields and the "packed" attribute and I came across a wierd behavior: struct __attribute__((packed)) { int a:12; int b:32; ...
Bostic asked 13/9, 2014 at 11:19

2

Solved

I have a packed struct defined as shown below typedef struct packed { logic bit1; logic [7:0] byte1; } MyPackedStruct; MyPackedStruct myPackedStruct; Is there any SV built in function that I ...
Gentianaceous asked 2/7, 2014 at 9:8

1

Solved

Is it possible in C to get the size of the following structure to be 2? #include <stdio.h> struct union_struct { char foo; char bar : 2; union { char foobar1 : 6; char foobar2 : 6; };...
Sir asked 5/9, 2013 at 23:12

2

Solved

In C/C++ you always have SizeOf(array[N] of T) = N * SizeOf(T); In Pascal/Delphi you can use 'packed array' to be sure that the above assert is true, but does 'packed' specifier have any practic...
Guyenne asked 3/1, 2011 at 11:18

3

Solved

It is C language.It is written that: typedef struct __attribute__((packed, aligned(4))) Ball { float2 delta; float2 position; //float3 color; float size; //int arcID; //float arcStr; } Ball_...
Footrace asked 2/8, 2012 at 2:59

2

Solved

As a continuation of my previous question, Simon's method to find the list product of a PackedArray is fast, but it does not work with negative values. This can be "fixed" by Abs with minimal time...
Unmanned asked 15/3, 2011 at 0:33

3

Solved

In Mathematica a vector (or rectangular array) containing all machine size integers or floats may be stored in a packed array. These objects take less memory, and some operations are much faster on...
Droppings asked 14/3, 2011 at 4:12

3

Solved

jquery-1.4.2.min.js is 71.8KB Same file compressed through this tool, with gzip enabled, becomes 32.9 KB Which is better? If latter, why doesn't jQuery provide a packed file too instead of just un...
Noonday asked 22/5, 2010 at 12:29
1

© 2022 - 2024 — McMap. All rights reserved.