This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Why stdarg.h is part of GCC instead of libc?
- From: VÃclav Haisman <vhaisman at gmail dot com>
- To: YuGiOhJCJ Mailing-List <yugiohjcj-mailinglist at laposte dot net>
- Cc: libc-help at sourceware dot org
- Date: Thu, 9 Jun 2016 10:21:12 +0200
- Subject: Re: Why stdarg.h is part of GCC instead of libc?
- Authentication-results: sourceware.org; auth=none
- References: <20160609043800 dot 4efdd06c4039b21703069061 at laposte dot net>
On 9 June 2016 at 04:38, YuGiOhJCJ Mailing-List wrote:
>
> Hello,
>
> I was checking from what package the headers I am using for a program are provided:
> * ctype.h: It is part of libc [1]
> * errno.h: It is part of libc
> * getopt.h: It is part of libc
> * limits.h: It is part of libc
> * ...
>
> Then I was amazed to discover that:
> * stdarg.h: It is part of gcc [2]
>
> I don't understand why.
> Maybe it is an historical reason or something like that.
> I don't see any reason to make the stdarg.h header part of GCC instead of libc.
> AFAIK, all these headers are standards C headers.
> In other words, they should not be specific to the compiler.
>
> Someone can explain me why stdarg.h is part of GCC instead of libc?
> Is it documented somewhere that stdarg.h is not part of libc?
> Are there other standard C headers like this one that are not part of libc?
>
> Thank you.
> Best regards.
>
> [1] https://www.gnu.org/software/libc/
> [2] https://gcc.gnu.org/
Contents of stdarg.h is historically very platform specific. It
depends on ABI of given platform and it is tied to how the ABI
specifies and the compiler implements variadic functions. E.g.,
va_start() is implemented in terms of __builtin_va_start().
--
VH