summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-09 05:16:57 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-09 05:18:53 +0000
commit3b188b4d2b3a992bd284fdeb591050924f7bd991 (patch)
tree51dac5b2a07864b6b5b1b5c1e257143820f58b3a /util
parent532d723ccda436eebec61719f7b5f5689001a546 (diff)
util/nvmutil: specifically enable -std=c99
I also needed: #define _POSIX_C_SOURCE 200809L I use -pedantic with -Wall -Wextra -Werror, which forces very strict error handling and ISO C; this means pread and pwrite aren't available. The define fixes this. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/Makefile2
-rw-r--r--util/nvmutil/nvmutil.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/util/nvmutil/Makefile b/util/nvmutil/Makefile
index 91b5ba1c..c6611075 100644
--- a/util/nvmutil/Makefile
+++ b/util/nvmutil/Makefile
@@ -3,7 +3,7 @@
# SPDX-FileCopyrightText: 2023 Riku Viitanen <riku.viitanen@protonmail.com>
CC?=cc
-CFLAGS?=-Os -Wall -Wextra -Werror -pedantic
+CFLAGS?=-Os -Wall -Wextra -Werror -pedantic -std=c99 -D_POSIX_C_SOURCE=200809L
DESTDIR?=
PREFIX?=/usr/local
INSTALL?=install
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 3ec92048..5aa000a2 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -2,6 +2,8 @@
/* Copyright (c) 2022-2026 Leah Rowe <leah@libreboot.org> */
/* Copyright (c) 2023 Riku Viitanen <riku.viitanen@protonmail.com> */
+#define _POSIX_C_SOURCE 200809L
+
#ifdef __OpenBSD__
#include <sys/param.h>
#endif