kframework / c-semantics

Semantics of C in K
Other
305 stars 40 forks source link

Handle fields with both tags and empty declarator lists #655

Closed mariaKt closed 3 years ago

mariaKt commented 3 years ago

Ignore fields with both tags and empty declarator lists in structs and unions, when creating fields for structs and unions.

This is to address the problem (reported by DENSO) regarding difference in struct sizes computed by gcc/clang and kcc. The struct's size was previously computed as 4 by kcc in the program Kevin provided (see below). pragmapack.c.txt

The added unit tests are modified versions of pragmapack.c.txt.