summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-02-04 13:45:45 -0500
committerTavian Barnes <tavianator@tavianator.com>2025-02-06 10:38:44 -0500
commitf8aca1c316b116c2de11d42010fdda0ddb418750 (patch)
treec75e31e1f895c92721fa31be2c559335b21de714 /build
parent532dec0849dcdc3e15e530ac40a8168f146a41cd (diff)
downloadbfs-f8aca1c316b116c2de11d42010fdda0ddb418750.tar.xz
diag: Try to make diagnostics signal-safer
Link: https://sourceware.org/bugzilla/show_bug.cgi?id=16060
Diffstat (limited to 'build')
-rw-r--r--build/has/dprintf.c8
-rw-r--r--build/header.mk1
2 files changed, 9 insertions, 0 deletions
diff --git a/build/has/dprintf.c b/build/has/dprintf.c
new file mode 100644
index 0000000..c206fa3
--- /dev/null
+++ b/build/has/dprintf.c
@@ -0,0 +1,8 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+#include <stdio.h>
+
+int main(void) {
+ return dprintf(1, "%s\n", "Hello world!");
+}
diff --git a/build/header.mk b/build/header.mk
index 6a63221..f8aee4b 100644
--- a/build/header.mk
+++ b/build/header.mk
@@ -21,6 +21,7 @@ HEADERS := \
gen/has/builtin-riscv-pause.h \
gen/has/compound-literal-storage.h \
gen/has/confstr.h \
+ gen/has/dprintf.h \
gen/has/extattr-get-file.h \
gen/has/extattr-get-link.h \
gen/has/extattr-list-file.h \