XenevaOS
Loading...
Searching...
No Matches
stdarg.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * <linux/stdarg.h> -- a forwarder to the compiler's <stdarg.h>, which is
4 * what mainline's is: two includes and a guard, no declarations of its own.
5 *
6 * This file did not start out that way. It carried its own
7 * `typedef __builtin_va_list va_list` plus the four va_* macros spelled over
8 * the builtins, and that was one typedef too many. The tree's <stdarg.h>
9 * resolves to BaseHdr/stdarg.h, which on this target typedefs va_list as
10 * `unsigned char*` and hand-walks it; so drm_print.c, which names both this
11 * header at line 33 and (through drm_print.h -> printk.h) <stdarg.h>, came
12 * out with "typedef redefinition with different types" and, once it picked a
13 * side, a va_start() binding a non-const lvalue reference to an unrelated
14 * type. One TU cannot have two va_list types, and this was the second copy.
15 *
16 * Forwarding is also the only arrangement that can work here, because the
17 * two users in this tree disagree about which va_list is right and the
18 * disagreement is not this file's to settle -- see the note above the
19 * #ifdef __GNUC__ in BaseHdr/stdarg.h. A header that re-decides the type
20 * forces the choice on both of them; a header that forwards lets the one
21 * place make it.
22 *
23 * <linux/types.h> is left out, though mainline's forwarder names it. mainline
24 * needs it for nothing that this header declares -- there is nothing here but
25 * the include -- and in DCL it is the aggregator: types.h:21 is
26 * `#include <linux/kernel.h>`, whose subtree reaches <linux/sched.h>, which
27 * unconditionally redefines the word `current` as a macro. The one source
28 * this header has (drm_print.c) does not need that, and the next one may
29 * include <Fs/vfs.h>.
30 */
31#ifndef _LINUX_STDARG_H
32#define _LINUX_STDARG_H
33
34#include <stdarg.h>
35
36#endif