Commit d1d5c07
Silence clang analyzer warnings
linux/LinuxProcessTable.c:795:11: warning: File position of the stream might be 'indeterminate' after a failed operation. Can cause undefined behavior [unix.Stream]
795 | while (fgets(buffer, sizeof(buffer), fp)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux/LinuxProcessTable.c:795:11: warning: Read function called when stream is in EOF state. Function has no effect [unix.Stream]
795 | while (fgets(buffer, sizeof(buffer), fp)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux/LinuxProcessTable.c:840:11: warning: File position of the stream might be 'indeterminate' after a failed operation. Can cause undefined behavior [unix.Stream]
840 | while (fgets(linebuf, sizeof(linebuf), file) != NULL) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux/LinuxProcessTable.c:840:11: warning: Read function called when stream is in EOF state. Function has no effect [unix.Stream]
840 | while (fgets(linebuf, sizeof(linebuf), file) != NULL) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux/LinuxMachine.c:81:22: warning: The 1st argument to 'openat' is between -99 and -1 but should be a valid file descriptor or AT_FDCWD [unix.StdCLibraryFunctions]
81 | int cpuDirFd = openat(dirfd(dir), entry->d_name, O_DIRECTORY | O_PATH | O_NOFOLLOW);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux/LinuxMachine.c:501:11: warning: File position of the stream might be 'indeterminate' after a failed operation. Can cause undefined behavior [unix.Stream]
501 | while (fgets(buffer, sizeof(buffer), file)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux/LinuxMachine.c:501:11: warning: Read function called when stream is in EOF state. Function has no effect [unix.Stream]
501 | while (fgets(buffer, sizeof(buffer), file)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux/Platform.c:467:22: warning: File position of the stream might be 'indeterminate' after a failed operation. Can cause undefined behavior [unix.Stream]
467 | } while ((bytes = fread(env + size, 1, capacity - size, fp)) > 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux/Platform.c:467:22: warning: Read function called when stream is in EOF state. Function has no effect [unix.Stream]
467 | } while ((bytes = fread(env + size, 1, capacity - size, fp)) > 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux/Platform.c:585:15: warning: File position of the stream might be 'indeterminate' after a failed operation. Can cause undefined behavior [unix.Stream]
585 | total = fscanf(fp, "full avg10=%32lf avg60=%32lf avg300=%32lf total=%*f ", ten, sixty, threehundred);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux/Platform.c:585:15: warning: Read function called when stream is in EOF state. Function has no effect [unix.Stream]
585 | total = fscanf(fp, "full avg10=%32lf avg60=%32lf avg300=%32lf total=%*f ", ten, sixty, threehundred);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux/Platform.c:789:21: warning: The 1st argument to 'openat' is between -99 and -1 but should be a valid file descriptor or AT_FDCWD [unix.StdCLibraryFunctions]
789 | int entryFd = openat(dirfd(dir), entryName, O_DIRECTORY | O_PATH);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1 parent f9bb289 commit d1d5c07
4 files changed
+34
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
155 | 172 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
505 | 507 | | |
506 | 508 | | |
507 | 509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
795 | 795 | | |
796 | 796 | | |
797 | 797 | | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
802 | 801 | | |
803 | | - | |
| 802 | + | |
804 | 803 | | |
805 | 804 | | |
806 | 805 | | |
| |||
840 | 839 | | |
841 | 840 | | |
842 | 841 | | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
| 842 | + | |
| 843 | + | |
847 | 844 | | |
848 | | - | |
849 | 845 | | |
850 | 846 | | |
851 | 847 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
| 467 | + | |
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
| 584 | + | |
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
789 | | - | |
| 789 | + | |
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
| |||
0 commit comments