I'm a little confused about the size of an enum in CVI. One entry in the Help file says, "The compilers always use 4 bytes to represent the largest enum value." Another entry says, "The size of an enumeration type depends on the value of its enumeration constant." According to sizeof an enum is 4 bytes even when it only has a single constant set to 0.
I would like know if there's some way to enforce that an enum always uses the smallest possible size (e.g., a #pragma or compiler option). I'm writing a CVI program to communicate with an embedded device. There's a communications header file that defines the data in the communciations packet, and the packet includes several enums. The embedded compiler uses 1-byte enums, so its packets don't align with CVI's packets.
I realize that the C standard says that enums are the same size as the platform's native int and that what I want to do is non-standard. I belive that previous versions of CVI did follow the "use the smallest size" rule, but I don't have an old version installed to test that theory (I'm using CVI 7.0.0).