git: 6ff6a0b58981 - stable/14 - Don't rely on sys/_types.h including sys/cdefs.h
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 23 Jun 2025 09:10:33 UTC
The branch stable/14 has been updated by brooks:
URL: https://cgit.FreeBSD.org/src/commit/?id=6ff6a0b589810f41cea06fbcdf21c5b0dd72e602
commit 6ff6a0b589810f41cea06fbcdf21c5b0dd72e602
Author: Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2025-06-11 16:39:01 +0000
Commit: Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2025-06-23 08:55:36 +0000
Don't rely on sys/_types.h including sys/cdefs.h
These headers relied in __BEGIN_DECS/__END_DECLS being defined when
sys/_types.h was included, but there's not a requirement that this be
the case.
Reviewed by: imp
Exp-run by: antoine (PR 286274)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
(cherry picked from commit b01e971fd39d10273a387788019457792873e81c)
(cherry picked from commit 4f4c465b45d42ed8d2b65c8b4c909246987ac877)
(cherry picked from commit 12913e4ddf710e517f3ae00b7b420b783cca9b37)
---
contrib/libexecinfo/execinfo.h | 2 ++
include/dlfcn.h | 1 +
lib/msun/aarch64/fenv.h | 1 +
lib/msun/arm/fenv.h | 1 +
lib/msun/riscv/fenv.h | 1 +
lib/msun/src/math.h | 1 +
sys/arm/include/sysarch.h | 2 ++
sys/arm64/include/sysarch.h | 2 ++
sys/sys/procdesc.h | 1 +
9 files changed, 12 insertions(+)
diff --git a/contrib/libexecinfo/execinfo.h b/contrib/libexecinfo/execinfo.h
index 22460967e83c..8a3c36b2da21 100644
--- a/contrib/libexecinfo/execinfo.h
+++ b/contrib/libexecinfo/execinfo.h
@@ -32,6 +32,8 @@
#ifndef _EXECINFO_H_
#define _EXECINFO_H_
+#include <sys/cdefs.h>
+
#include <stddef.h>
__BEGIN_DECLS
diff --git a/include/dlfcn.h b/include/dlfcn.h
index 89ec43b332e9..9a4ac0faf786 100644
--- a/include/dlfcn.h
+++ b/include/dlfcn.h
@@ -32,6 +32,7 @@
#ifndef _DLFCN_H_
#define _DLFCN_H_
+#include <sys/cdefs.h>
#include <sys/_types.h>
/*
diff --git a/lib/msun/aarch64/fenv.h b/lib/msun/aarch64/fenv.h
index 2148a68b053b..a435a9de5223 100644
--- a/lib/msun/aarch64/fenv.h
+++ b/lib/msun/aarch64/fenv.h
@@ -31,6 +31,7 @@
#ifndef _FENV_H_
#define _FENV_H_
+#include <sys/cdefs.h>
#include <sys/_types.h>
#ifndef __fenv_static
diff --git a/lib/msun/arm/fenv.h b/lib/msun/arm/fenv.h
index 5dded5d744fd..e8a30fcf496f 100644
--- a/lib/msun/arm/fenv.h
+++ b/lib/msun/arm/fenv.h
@@ -29,6 +29,7 @@
#ifndef _FENV_H_
#define _FENV_H_
+#include <sys/cdefs.h>
#include <sys/_types.h>
#ifndef __fenv_static
diff --git a/lib/msun/riscv/fenv.h b/lib/msun/riscv/fenv.h
index 36abb7b00b7d..62bdf65b70d1 100644
--- a/lib/msun/riscv/fenv.h
+++ b/lib/msun/riscv/fenv.h
@@ -36,6 +36,7 @@
#ifndef _FENV_H_
#define _FENV_H_
+#include <sys/cdefs.h>
#include <sys/_types.h>
#ifndef __fenv_static
diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h
index 405434752336..8e72beb757f8 100644
--- a/lib/msun/src/math.h
+++ b/lib/msun/src/math.h
@@ -16,6 +16,7 @@
#ifndef _MATH_H_
#define _MATH_H_
+#include <sys/cdefs.h>
#include <sys/_types.h>
#include <machine/_limits.h>
diff --git a/sys/arm/include/sysarch.h b/sys/arm/include/sysarch.h
index 907a84f39e58..e0a8e0039b99 100644
--- a/sys/arm/include/sysarch.h
+++ b/sys/arm/include/sysarch.h
@@ -38,6 +38,8 @@
#ifndef _ARM_SYSARCH_H_
#define _ARM_SYSARCH_H_
+#include <sys/cdefs.h>
+
#include <machine/armreg.h>
#ifndef LOCORE
diff --git a/sys/arm64/include/sysarch.h b/sys/arm64/include/sysarch.h
index f72d3427602e..d5d58000309e 100644
--- a/sys/arm64/include/sysarch.h
+++ b/sys/arm64/include/sysarch.h
@@ -39,6 +39,8 @@
#ifndef _MACHINE_SYSARCH_H_
#define _MACHINE_SYSARCH_H_
+#include <sys/cdefs.h>
+
#define ARM64_GET_SVE_VL 0x200
/* Reserved ARM64_SET_SVE_VL 0x201 */
diff --git a/sys/sys/procdesc.h b/sys/sys/procdesc.h
index 4e8b06fb7377..81102dffa6ff 100644
--- a/sys/sys/procdesc.h
+++ b/sys/sys/procdesc.h
@@ -108,6 +108,7 @@ int procdesc_falloc(struct thread *, struct file **, int *, int,
#else /* !_KERNEL */
+#include <sys/cdefs.h>
#include <sys/_types.h>
#ifndef _PID_T_DECLARED