2 !!DESCRIPTION!! C-Manual Chapter 8.8: typedef
3 !!ORIGIN!! LCC 4.1 Testsuite
4 !!LICENCE!! own, freely distributeable for non-profit. read CPYRIGHT.LCC
8 int cbits; /* No. of bits per char */
10 int sbits; /* short */
12 int ubits; /* unsigned */
13 int fbits; /* float */
14 int dbits; /* double */
16 float fprec; /* Smallest number that can be */
17 float dprec; /* significantly added to 1. */
19 int flgs; /* Print return codes, by section */
20 int flgm; /* Announce machine dependencies */
21 int flgd; /* give explicit diagnostics */
22 int flgl; /* Report local return codes. */
23 int rrc; /* recent return code */
24 int crc; /* Cumulative return code */
25 char rfs[8]; /* Return from section */
29 int ubits; /* unsigned */
30 int fbits; /* float */
31 int dbits; /* double */
33 float fprec; /* Smallest number that can be */
34 float dprec; /* significantly added to 1. */
36 int flgs; /* Print return codes, by section */
37 int flgm; /* Announce machine dependencies */
38 int flgd; /* give explicit diagnostics */
39 int flgl; /* Report local return codes. */
40 int rrc; /* recent return code */
41 int crc; /* Cumulative return code */
42 char rfs[8]; /* Return from section */
48 #ifndef NO_OLD_FUNC_DECL
49 s88(pd0) /* 8.8 Typedef */
53 int s88(struct defs *pd0){
55 static char s88er[] = "s88,er%d\n";
56 static char qs88[8] = "s88 ";
60 /* Declarations whose "storage class" is typdef do not
61 define storage, but instead define identifiers which
62 can later be used as if they were type keywords naming
63 fundamental or derived types.
66 typedef int MILES, *KLICKSP;
69 typedef struct {double re, im;} complex;
71 typedef struct {signed re, im;} complex;
75 #ifndef NO_SLOPPY_EXTERN
76 extern KLICKSP metricp;
87 /* Hopefully, all of this stuff will compile. After that,
88 we can only make some superficial tests.
90 The type of distance is int,
93 if(sizeof distance != sizeof(int)){
94 if(pd0->flgd != 0) printf(s88er,1);
98 /* that of metricp is "pointer to int", */
105 if(pd0->flgd != 0) printf(s88er,2);
109 /* and that of z is the specified structure. zp is a
110 pointer to such a structure.
128 if(pd0->flgd != 0) printf(s88er,4);
135 /*********************************************************************************************
136 the main loop that launches the sections
137 *********************************************************************************************/
139 #ifndef NO_TYPELESS_STRUCT_PTR
140 int section(int j,struct* pd0){
142 int section(int j,void* pd0){
145 case 0: return s88(pd0);
149 #define cq_sections 1
152 C REFERENCE MANUAL (main)
155 #ifndef NO_OLD_FUNC_DECL
161 int main(int n,char **args) {
165 static struct defs d0, *pd0;
167 d0.flgs = 1; /* These flags dictate */
168 d0.flgm = 1; /* the verbosity of */
169 d0.flgd = 1; /* the program. */
174 for (j=0; j<cq_sections; j++) {
175 d0.rrc=section(j,pd0);
176 d0.crc=d0.crc+d0.rrc;
177 if(d0.flgs != 0) printf("Section %s returned %d.\n",d0.rfs,d0.rrc);
180 if(d0.crc == 0) printf("\nNo errors detected.\n");
181 else printf("\nFailed.\n");