Why va_start takes 2 arguments

Discussion in 'C Programming' started by Minti, Sep 3, 2004.

  1. Minti

    Minti Guest

    I was just checking


    http://docs.freebsd.org/info/gcc/gcc.info.Varargs.html

    and

    http://www-ccs.ucsd.edu/c/stdarg.html

    I seemed to have never given this simple thing much thought, but I was just
    curious of the reason why this might be the case so I checked up the
    Rationale at

    http://www.lysator.liu.se/c/rat/d8.html

    And it seems to have confused me more than before. Can anyone provide any
    insight into what sort of implementations might find the second argument
    intresting? And what is this thing about registers and function pointers.

    Thanks.
     
    Minti, Sep 3, 2004
    #1
    1. Advertising

  2. Minti

    Ben Pfaff Guest

    "Minti" <> writes:

    [about va_start]
    > Can anyone provide any insight into what sort of
    > implementations might find the second argument intresting? And
    > what is this thing about registers and function pointers.


    In many implementations, va_start(list, arg) basically does
    something similar to list = &arg + 1. Without the second
    argument, the implementation would need an extension that
    provided the last argument, e.g. a magic identifier like
    __last_arg.
    --
    Ben Pfaff
    email:
    web: http://benpfaff.org
     
    Ben Pfaff, Sep 3, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. frankg
    Replies:
    4
    Views:
    417
    Joe Durusau
    Jul 28, 2003
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,261
    Smokey Grindel
    Dec 2, 2006
  3. Neo
    Replies:
    10
    Views:
    702
    sushant
    Jan 20, 2005
  4. mahesha
    Replies:
    3
    Views:
    1,963
    Larry Smith
    Oct 5, 2006
  5. tukki
    Replies:
    0
    Views:
    366
    tukki
    Jul 30, 2010
Loading...

Share This Page