Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jun 2025 18:08:11 +0100
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: c190cd94b7bf - main - sys/_stdarg.h: drop cdefs.h and _types.h polution
Message-ID:  <CDCBD29E-0348-4FD0-ADC9-A0997B0444A0@freebsd.org>
In-Reply-To: <202506111700.55BH0PPx042716@gitrepo.freebsd.org>
References:  <202506111700.55BH0PPx042716@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11 Jun 2025, at 18:00, Brooks Davis <brooks@freebsd.org> wrote:
>=20
> The branch main has been updated by brooks:
>=20
> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3Dc190cd94b7bff590b06db906c5678952=
5a991ece
>=20
> commit c190cd94b7bff590b06db906c56789525a991ece
> Author:     Brooks Davis <brooks@FreeBSD.org>
> AuthorDate: 2025-06-11 16:39:02 +0000
> Commit:     Brooks Davis <brooks@FreeBSD.org>
> CommitDate: 2025-06-11 16:39:02 +0000
>=20
>    sys/_stdarg.h: drop cdefs.h and _types.h polution
>=20
>    Rely in sys/_visible for visibility macros and use __buitin_va_list
>    instead of __va_list everywere we declare va_list.

This layout seems odd. I would expect sys/sys/_stdarg.h to define
__va_list, which stdio.h and wchar.h can then include and use __va_list
for their va_list, like how we do things for __[u]intN_t.

Jess

>    Reviewed by:    imp
>    Exp-run by:     antoine (PR 286274)
>    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1595
> ---
> include/stdio.h   | 2 +-
> include/wchar.h   | 2 +-
> sys/sys/_stdarg.h | 7 +++----
> 3 files changed, 5 insertions(+), 6 deletions(-)
>=20
> diff --git a/include/stdio.h b/include/stdio.h
> index 3dedb8fd5a54..34e877b60c14 100644
> --- a/include/stdio.h
> +++ b/include/stdio.h
> @@ -74,7 +74,7 @@ typedef __off64_t off64_t;
>=20
> #if __POSIX_VISIBLE >=3D 200112 || __XSI_VISIBLE
> #ifndef _VA_LIST_DECLARED
> -typedef __va_list va_list;
> +typedef __builtin_va_list va_list;
> #define _VA_LIST_DECLARED
> #endif
> #endif
> diff --git a/include/wchar.h b/include/wchar.h
> index e4b037c9b16f..bf07062935d5 100644
> --- a/include/wchar.h
> +++ b/include/wchar.h
> @@ -78,7 +78,7 @@ typedef __size_t size_t;
>=20
> #if __POSIX_VISIBLE >=3D 200809 || __XSI_VISIBLE
> #ifndef _VA_LIST_DECLARED
> -typedef __va_list va_list;
> +typedef __builtin_va_list va_list;
> #define _VA_LIST_DECLARED
> #endif
> #endif
> diff --git a/sys/sys/_stdarg.h b/sys/sys/_stdarg.h
> index 063e59dc83f6..3886f4632b10 100644
> --- a/sys/sys/_stdarg.h
> +++ b/sys/sys/_stdarg.h
> @@ -31,12 +31,11 @@
> #ifndef _SYS__STDARG_H_
> #define _SYS__STDARG_H_
>=20
> -#include <sys/cdefs.h>
> -#include <sys/_types.h>
> +#include <sys/_visible.h>
>=20
> #ifndef _VA_LIST_DECLARED
> -  #define _VA_LIST_DECLARED
> -  typedef __va_list       va_list;
> +#define _VA_LIST_DECLARED
> +typedef __builtin_va_list va_list;
> #endif
>=20
> #define va_start(ap, last) __builtin_va_start((ap), (last))




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CDCBD29E-0348-4FD0-ADC9-A0997B0444A0>