2 !!DESCRIPTION!! C-Manual Chapter 7.15: Comma operator
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 */
44 /*#include "cq26.c"*/ /* hardware check */
45 #ifdef NO_IMPLICIT_FUNC_PROTOTYPES
46 s715f(int x,int y,int z);
49 #ifndef NO_OLD_FUNC_DECL
50 s715(pd0) /* 7.15 Comma operator */
54 int s715(struct defs *pd0) {
56 static char s715er[] = "s715,er%d\n";
57 static char qs715[8] = "s715 ";
65 while (*pt++ = *ps++);
67 /* A pair of expressions separated by a comma is
68 evaluated left to right and the value of the left
69 expression is discarded.
72 if( i++,i++,i++,i++,++i != 6 ){
73 if(pd0->flgd != 0) printf(s715er,1);
77 /* In contexts where the comma is given a special mean-
78 ing, for example in a list of actual arguments to
79 functions (sic) and lists of initializers, the comma
80 operator as described in this section can only appear
81 in parentheses; for example
85 has three arguments, the second of which has the
89 if(s715f(a, (t=3, t+2), c) != 5){
90 if(pd0->flgd != 0) printf(s715er,2);
101 /*********************************************************************************************
102 the main loop that launches the sections
103 *********************************************************************************************/
105 #ifndef NO_TYPELESS_STRUCT_PTR
106 int section(int j,struct* pd0){
108 int section(int j,void* pd0){
111 /*case 0: return s26(pd0);*/
112 case 0: return s715(pd0);
116 #define cq_sections 1
119 C REFERENCE MANUAL (main)
122 #ifndef NO_OLD_FUNC_DECL
128 int main(int n,char **args) {
132 static struct defs d0, *pd0;
134 d0.flgs = 1; /* These flags dictate */
135 d0.flgm = 1; /* the verbosity of */
136 d0.flgd = 1; /* the program. */
141 for (j=0; j<cq_sections; j++) {
142 d0.rrc=section(j,pd0);
143 d0.crc=d0.crc+d0.rrc;
144 if(d0.flgs != 0) printf("Section %s returned %d.\n",d0.rfs,d0.rrc);
147 if(d0.crc == 0) printf("\nNo errors detected.\n");
148 else printf("\nFailed.\n");