public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* How to check the source code of stdarg?
@ 2011-11-02 13:37 Parmenides
  2011-11-02 18:16 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Parmenides @ 2011-11-02 13:37 UTC (permalink / raw)
  To: Gcc mailing list

Hi,

    The gcc implements the stdarg.h to support variable parameters
functions. I wonder how it work. So, I find the stdarg.h at


/usr/lib/gcc/i486-pc-linux-gnu/4.1.2/include/stdarg.h

Open it , I found some definitions as follows:

#define va_start(v,l)   __builtin_va_start(v,l)
#define va_end(v)       __builtin_va_end(v)
#define va_arg(v,l)     __builtin_va_arg(v,l)

Every macro has its __builtin_...  version. I try to look for these
'__builtin_...' in gcc source code, but has not found. So, I want to
know how to check their source code.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to check the source code of stdarg?
  2011-11-02 13:37 How to check the source code of stdarg? Parmenides
@ 2011-11-02 18:16 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2011-11-02 18:16 UTC (permalink / raw)
  To: Parmenides; +Cc: Gcc mailing list

Parmenides <mobile.parmenides@gmail.com> writes:

>     The gcc implements the stdarg.h to support variable parameters
> functions. I wonder how it work. So, I find the stdarg.h at
>
>
> /usr/lib/gcc/i486-pc-linux-gnu/4.1.2/include/stdarg.h
>
> Open it , I found some definitions as follows:
>
> #define va_start(v,l)   __builtin_va_start(v,l)
> #define va_end(v)       __builtin_va_end(v)
> #define va_arg(v,l)     __builtin_va_arg(v,l)
>
> Every macro has its __builtin_...  version. I try to look for these
> '__builtin_...' in gcc source code, but has not found. So, I want to
> know how to check their source code.

For va_start and va_end, see gcc/builtins.c.  Look for BUILT_IN_VA_START
and BUILT_IN_VA_END.  For va_arg, look in c-*.[ch] and c-family/* and
cp/* for RID_VA_ARG.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-02 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-02 13:37 How to check the source code of stdarg? Parmenides
2011-11-02 18:16 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).