Files
flatpak/tests/apply-extra-static.c
bbhtt a38377eb88 tests: Suppress an unused-result warning
The warning seems to happen with GCC 11 but not with GCC 13 or newer.

A simple void cast still leaves the warning enabled due to a bug
or intentional choice in GCC [1], so it is assigned to a variable first
and then void-ed.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
2026-05-27 14:32:40 +00:00

17 lines
367 B
C

#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
static const char msg[] = "noruntime-extra-data\n";
int main(void) {
mkdir("/app/extra", 0755);
int fd = open("/app/extra/ran", O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd < 0)
return 1;
ssize_t ret = write(fd, msg, sizeof(msg) - 1);
(void)ret;
close(fd);
return 0;
}