Here is a valid C program that does nothing but declare 2 structures. One struct has type S, which is defined in this source file, and another has complex, which is defined in <math.h>.
#include <math.h>
struct S {
int a;
char b;
double d;
};
int main(void) {
struct S s;
struct complex c;
s.a = 1;
s.b = 'b';
s.d = 1.4;
c.x = 1;
c.y = 3;
return 1;
}
When this program is built with options list(listing) and list(allStructVar), the output is similar to the lines below. The third structure shown, exception, is defined by VisualAge C++ and does not appear if the program is built with list(refStructVar) instead of list(allStructVar). Only the prolog section appears when list(listing) is the only listing option specified for the build.
Some lines have been omitted, and others may vary for different installations.
* * * * * P R O L O G * * * * *
Compiler . . . . . . . . . . . . : IBM VisualAge C++
Program name. . . . . . . . . : structma.c Object name . . . . . . . . . : structma.obj Listing name. . . . . . . . . : structma.lst
* * * * * S T R U C T U R E M A P S * * * * *
============================================================== | Aggregate map for: struct S Total size: 16 bytes | |============================================================| | Offset | Length | Member Name | | | Bytes(Bits) | Bytes(Bits) | | |============================================================| | 0 | 4 | a | | 4 | 1 | b | | 5 | 3 | ***PADDING*** | | 8 | 8 | d | ==============================================================
============================================================== | Aggregate map for: struct complex Total size: 16 bytes | |============================================================| | Offset | Length | Member Name | | Bytes(Bits) | Bytes(Bits) | | |============================================================= | 0 | 8 | x | | 8 | 8 | y | ==============================================================
============================================================== | Aggregate map for: struct exception Total size: 32 bytes | |============================================================| | Offset | Length | Member Name | | Bytes(Bits) | Bytes(Bits) | | |============================================================| | 0 | 4 | type | | 4 | 4 | name | | 8 | 8 | arg1 | | 16 | 8 | arg2 | | 24 | 8 | retval | ==============================================================
