File tree Expand file tree Collapse file tree 1 file changed +0
-53
lines changed Expand file tree Collapse file tree 1 file changed +0
-53
lines changed Original file line number Diff line number Diff line change @@ -364,19 +364,6 @@ void fflush_on_open_failed_stream(void) {
364
364
fclose (F );
365
365
}
366
366
367
- void test_fscanf_eof () {
368
- FILE * F1 = tmpfile ();
369
- if (!F1 )
370
- return ;
371
-
372
- int a ;
373
- unsigned b ;
374
- int ret = fscanf (F1 , "%d %u" , & a , & b );
375
- char c = fgetc (F1 ); // expected-warning {{Read function called when stream is in EOF state. Function has no effect}}
376
- // expected-warning@-1 {{File position of the stream might be 'indeterminate' after a failed operation. Can cause undefined behavior}}
377
- fclose (F1 );
378
- }
379
-
380
367
void test_fscanf_escape () {
381
368
FILE * F1 = tmpfile ();
382
369
if (!F1 )
@@ -408,46 +395,6 @@ void test_fscanf_escape() {
408
395
fclose (F1 );
409
396
}
410
397
411
- void test_fputc () {
412
- FILE * F1 = tmpfile ();
413
- if (!F1 )
414
- return ;
415
-
416
- char a = 'y' ; // 'y' = 121 ASCII
417
- char r = fputc (a , F1 );
418
- if (r != EOF ) {
419
- clang_analyzer_dump_char (r ); // expected-warning {{121 S8b}}
420
- char z = fgetc (F1 );
421
- } else {
422
- clang_analyzer_dump_char (r ); // expected-warning {{-1 S8b}}
423
- }
424
-
425
- fclose (F1 );
426
- }
427
-
428
- void test_fputs () {
429
- FILE * F1 = tmpfile ();
430
- if (!F1 )
431
- return ;
432
-
433
- char buffer [] = "HELLO" ;
434
- int r = fputs (buffer , F1 );
435
- if (r >= 0 ) {
436
- // fputs does not invalidate the input buffer (72 is ascii for 'H')
437
- clang_analyzer_dump_char (buffer [0 ]); // expected-warning {{72 S8b}}
438
- } else if (r == EOF ) {
439
- // fputs does not invalidate the input buffer, *and* this branch
440
- // can happen
441
- clang_analyzer_dump_char (buffer [0 ]); // expected-warning {{72 S8b}}
442
- } else {
443
- // This branch can not happen
444
- int * p = NULL ;
445
- * p = 0 ;
446
- }
447
-
448
- fclose (F1 );
449
- }
450
-
451
398
void test_fprintf () {
452
399
FILE * F1 = tmpfile ();
453
400
if (!F1 )
You can’t perform that action at this time.
0 commit comments