Lines Matching defs:F

32   FILE *F = fopen("file", "r"); // expected-note {{Stream opened here}}
34 if (!F)
35 // expected-note@-1 {{'F' is non-null}}
43 FILE *F = fopen("file", "r"); // expected-note {{Stream opened here}}
45 if (!F)
46 // expected-note@-1 {{'F' is non-null}}
49 F = freopen(0, "w", F); // expected-note {{Stream reopened here}}
51 if (!F)
52 // expected-note@-1 {{'F' is non-null}}
60 FILE *F = fdopen(fd, "r"); // expected-note {{Stream opened here}}
62 if (!F)
63 // expected-note@-1 {{'F' is non-null}}
104 FILE *F;
105 F = fopen("foo1.c", "r"); // expected-note {{Value assigned to 'F'}} expected-note {{Assuming pointer value is null}}
107 if (F != NULL) { // expected-note {{Taking false branch}} expected-note {{'F' is equal to NULL}}
108 fclose(F);
111 fclose(F); // expected-warning {{Stream pointer might be NULL}}
116 FILE *F;
118 F = fopen("foo1.c", "r");
119 if (F == NULL) { // expected-note {{Taking false branch}} expected-note {{'F' is not equal to NULL}}
122 fread(Buf, 1, 1, F);
123 if (feof(F)) { // expected-note {{Taking true branch}}
124 clearerr(F);
125 fread(Buf, 1, 1, F); // expected-note {{Assuming stream reaches end-of-file here}}
126 if (feof(F)) { // expected-note {{Taking true branch}}
127 fread(Buf, 1, 1, F); // expected-warning {{Read function called when stream is in EOF state. Function has no effect}}
131 fclose(F);
135 FILE *F;
137 F = fopen("foo1.c", "r");
138 if (F == NULL) { // expected-note {{Taking false branch}} expected-note {{'F' is not equal to NULL}}
141 fread(Buf, 1, 1, F);
142 if (feof(F)) { // expected-note {{Taking false branch}}
143 fclose(F);
145 } else if (ferror(F)) { // expected-note {{Taking false branch}}
146 fclose(F);
149 fread(Buf, 1, 1, F); // expected-note {{Assuming stream reaches end-of-file here}}
150 if (feof(F)) { // expected-note {{Taking true branch}}
151 fread(Buf, 1, 1, F); // expected-warning {{Read function called when stream is in EOF state. Function has no effect}}
154 fclose(F);
158 FILE *F;
160 F = fopen("foo1.c", "r");
161 if (F == NULL) // expected-note {{Taking false branch}} expected-note {{'F' is not equal to NULL}}
163 int RRet = fread(Buf, 1, 1, F); // expected-note {{Assuming stream reaches end-of-file here}}
164 if (ferror(F)) { // expected-note {{Taking false branch}}
166 fread(Buf, 1, 1, F); // expected-warning {{Read function called when stream is in EOF state. Function has no effect}}
169 fclose(F);
173 FILE *F;
174 F = fopen("foo1.c", "r");
175 if (F == NULL) // expected-note {{Taking false branch}} \
176 // expected-note {{'F' is not equal to NULL}}
178 int R = fgetc(F); // no note
181 fgetc(F); // expected-note {{Assuming this stream operation fails}}
182 if (ferror(F)) // expected-note {{Taking true branch}}
183 fgetc(F); // expected-warning {{File position of the stream might be 'indeterminate' after a failed operation. Can cause undefined behavior}} \
186 fclose(F);
190 FILE *F;
192 F = fopen("foo1.c", "r");
193 if (F == NULL) // expected-note {{Taking false branch}} \
194 // expected-note {{'F' is not equal to NULL}}
196 fread(Buf, 1, 1, F); // expected-note {{Assuming this stream operation fails}}
197 if (ferror(F)) { // expected-note {{Taking true branch}}
198 clearerr(F);
199 fread(Buf, 1, 1, F); // expected-warning {{might be 'indeterminate' after a failed operation}} \
202 fclose(F);
206 FILE *F;
208 F = fopen("foo1.c", "r");
209 if (F == NULL) // expected-note {{Taking false branch}} \
210 // expected-note {{'F' is not equal to NULL}} \
212 // expected-note {{'F' is not equal to NULL}}
214 fgets(Buf, sizeof(Buf), F); // expected-note {{Assuming this stream operation fails}} \
217 fgets(Buf, sizeof(Buf), F); // expected-warning {{might be 'indeterminate'}} \
221 fclose(F);
225 FILE *F = fopen("file", "r");
226 if (!F) // expected-note {{Taking false branch}} \
227 // expected-note {{'F' is non-null}}
229 int Ret = fseek(F, 1, SEEK_SET); // expected-note {{Assuming this stream operation fails}}
233 fwrite(Buf, 1, 2, F); // expected-warning {{might be 'indeterminate'}} \
236 fclose(F);
240 FILE *F = fopen("file", "r");
241 if (!F) // expected-note {{Taking false branch}} \
242 // expected-note {{'F' is non-null}}
244 fseek(F, 0, SEEK_END); // expected-note {{Assuming this stream operation fails}}
245 long size = ftell(F); // expected-warning {{might be 'indeterminate'}} \
248 fclose(F);
252 fprintf(F, "abcd");
253 fclose(F);
257 FILE *F = fopen("file", "r");
258 if (!F)
260 if (fseek(F, 22, SEEK_SET) == -1) {
261 fclose(F);
264 fgetc(F); // no warning
265 fclose(F);
269 FILE *F = tmpfile();
270 if (!F) // expected-note {{'F' is non-null}} expected-note {{Taking false branch}}
272 fclose(F); // expected-note {{Stream is closed here}}
273 rewind(F); // expected-warning {{Use of a stream that might be already closed}}