I suggest you ...

generate an Info message for inefficient structure packing

Since PC-Lint already has the size and alignment information, it could determine if structures members are not arranged most efficiently.

For example, in a standard 32-bit system, a structure defined as

struct foo
{
uint32_t a;
uint8_t b;
uint16_t c;
}

is not most efficiently arranged, requiring an additional padding byte between b and c to achieve the necessary alignment for c. A more efficient method would be to define foo as

struct foo
{
uint32_t a;
uint16_t b;
uint8_t c;
}

I think Lint could determine this and generate some Info message for struct name.

4 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Michael Metivier shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base