| | @@ -490,3 +490,26 @@ |
| 490 | 490 | by another program (`WCONTINUED`) would need a fifth `Status`, which |
| 491 | 491 | breaks a `match` on `Status` that names all four, so it is left out: |
| 492 | 492 | the shell knows when it continues a job itself. |
| 493 | + |
| 494 | +## `Sys.syncAll`'s unused parameter, in the C `Sys` |
| 495 | + |
| 496 | +`lib/Sys.raz`, the `Sys` over the C library, has `syncAll(fd)` call |
| 497 | +C's `sync`, which takes no file and flushes every file system; so `fd` |
| 498 | +is never used, and a program built over it with `-Werror` fails: |
| 499 | + |
| 500 | +``` |
| 501 | +lib/Sys.raz:249:15: error: parameter fd is never used |
| 502 | +``` |
| 503 | + |
| 504 | +Linux's `Sys` uses `fd` (`syncfs`), so only the C one warns, and only |
| 505 | +for a program that imports `Sys`, which is most. raz's own checks |
| 506 | +build `test/libc` without `-Werror`, so they don't see it. |
| 507 | + |
| 508 | +The proposal: call the parameter `_fd` in `lib/Sys.raz`, as the |
| 509 | +warning says. A parameter's name isn't part of the signature (5.9), |
| 510 | +so the interface check between the two files still holds, and no |
| 511 | +program changes. It is a mend of the library, not a wish: it could |
| 512 | +come with any release. |
| 513 | + |
| 514 | +Met in rless, whose `make rless-c` builds over the C `Sys` without |
| 515 | +`-Werror` for this alone. |